diff options
author | Ben Pfaff <blp@nicira.com> | 2014-01-10 15:17:43 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2014-01-13 15:45:31 -0800 |
commit | 0934ebbad0fda79dfae38e2de62cca7f9c7227b4 (patch) | |
tree | 64e3c19e2fb8f7fa7331726b9d4e4d3908791f1d | |
parent | ad1aaa8b0318280a32f74e4bdf4ec2ff23d278bf (diff) | |
download | openvswitch-0934ebbad0fda79dfae38e2de62cca7f9c7227b4.tar.gz |
ofproto-dpif: Un-wildcard nw_frag only for protocols that have fragments.
The revalidator code in ofproto-dpif-upcall.c, in revalidate_ukey(),
deletes any datapath flow for which the kernel reports wildcarded bits
that userspace requires to be matched. Until now, a couple of pieces of
code in ofproto-dpif always marked nw_frag (which tracks whether a packet
is an IPv4 or IPV6 fragment) as exact-match. For non-IP protocols, this
wasn't meaningful, so adding such a flow to the datapath and then receiving
it back caused nw_frag to become wildcarded, so revalidate_ukey() always
deleted them.
This fixes the problem by only un-wildcarding nw_frag for protocols where
it is defined (IPv4 and IPv6).
Noticed while observing CFM traffic (which isn't IP based) over a tunnel.
Reported-by: Guolin Yang <gyang@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
-rw-r--r-- | ofproto/ofproto-dpif-xlate.c | 6 | ||||
-rw-r--r-- | ofproto/ofproto-dpif.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 8b3021ce5..e73b7eb34 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. +/* Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3077,7 +3077,9 @@ xlate_actions__(struct xlate_in *xin, struct xlate_out *xout) memset(&wc->masks.in_port, 0xff, sizeof wc->masks.in_port); memset(&wc->masks.skb_priority, 0xff, sizeof wc->masks.skb_priority); memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); - wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + if (is_ip_any(flow)) { + wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + } tnl_may_send = tnl_xlate_init(&ctx.base_flow, flow, wc); if (ctx.xbridge->netflow) { diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 62c1e4ca5..d5853b887 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -3008,7 +3008,9 @@ rule_dpif_lookup_in_table(struct ofproto_dpif *ofproto, if (wc) { memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type); - wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + if (is_ip_any(flow)) { + wc->masks.nw_frag |= FLOW_NW_FRAG_MASK; + } } cls = &ofproto->up.tables[table_id].cls; |