aboutsummaryrefslogtreecommitdiff
path: root/lib/dpif.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-10-19 21:33:44 -0700
committerBen Pfaff <blp@nicira.com>2011-10-21 15:07:36 -0700
commit7257b535ab8e5fafd811c5f6788205eefdd44948 (patch)
tree75072ea003837f756ce6910fb5e0ba3113db30be /lib/dpif.c
parent4edb9ae90e4092f5f56b9d914d2b88783c49860d (diff)
Implement new fragment handling policy.
Until now, OVS has handled IP fragments more awkwardly than necessary. It has not been possible to match on L4 headers, even in fragments with offset 0 where they are actually present. This means that there was no way to implement ACLs that treat, say, different TCP ports differently, on fragmented traffic; instead, all decisions for fragment forwarding had to be made on the basis of L2 and L3 headers alone. This commit improves the situation significantly. It is still not possible to match on L4 headers in fragments with nonzero offset, because that information is simply not present in such fragments, but this commit adds the ability to match on L4 headers for fragments with zero offset. This means that it becomes possible to implement ACLs that drop such "first fragments" on the basis of L4 headers. In practice, that effectively blocks even fragmented traffic on an L4 basis, because the receiving IP stack cannot reassemble a full packet when the first fragment is missing. This commit works by adding a new "fragment type" to the kernel flow match and making it available through OpenFlow as a new NXM field named NXM_NX_IP_FRAG. Because OpenFlow 1.0 explicitly says that the L4 fields are always 0 for IP fragments, it adds a new OpenFlow fragment handling mode that fills in the L4 fields for "first fragments". It also enhances ovs-ofctl to allow users to configure this new fragment handling mode and to parse the new field. Signed-off-by: Ben Pfaff <blp@nicira.com> Bug #7557.
Diffstat (limited to 'lib/dpif.c')
-rw-r--r--lib/dpif.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/dpif.c b/lib/dpif.c
index a95985a1..68a95f67 100644
--- a/lib/dpif.c
+++ b/lib/dpif.c
@@ -388,33 +388,6 @@ dpif_get_dp_stats(const struct dpif *dpif, struct dpif_dp_stats *stats)
return error;
}
-/* Retrieves the current IP fragment handling policy for 'dpif' into
- * '*drop_frags': true indicates that fragments are dropped, false indicates
- * that fragments are treated in the same way as other IP packets (except that
- * the L4 header cannot be read). Returns 0 if successful, otherwise a
- * positive errno value. */
-int
-dpif_get_drop_frags(const struct dpif *dpif, bool *drop_frags)
-{
- int error = dpif->dpif_class->get_drop_frags(dpif, drop_frags);
- if (error) {
- *drop_frags = false;
- }
- log_operation(dpif, "get_drop_frags", error);
- return error;
-}
-
-/* Changes 'dpif''s treatment of IP fragments to 'drop_frags', whose meaning is
- * the same as for the get_drop_frags member function. Returns 0 if
- * successful, otherwise a positive errno value. */
-int
-dpif_set_drop_frags(struct dpif *dpif, bool drop_frags)
-{
- int error = dpif->dpif_class->set_drop_frags(dpif, drop_frags);
- log_operation(dpif, "set_drop_frags", error);
- return error;
-}
-
/* Attempts to add 'netdev' as a port on 'dpif'. If successful, returns 0 and
* sets '*port_nop' to the new port's port number (if 'port_nop' is non-null).
* On failure, returns a positive errno value and sets '*port_nop' to