This patch changes flow_mask_hash_fields() so it doesn't unwildcard
the upper half of tp_src and tp_dst with ICMP packets.  Unfortunately,
this matters in future patches when we compare masks carefully to
determine if flows should be evicted from the datapath.

Signed-off-by: Ethan Jackson <et...@nicira.com>
---
 lib/flow.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/flow.c b/lib/flow.c
index 0dfd01f..929ca29 100644
--- a/lib/flow.c
+++ b/lib/flow.c
@@ -913,8 +913,13 @@ flow_mask_hash_fields(const struct flow *flow, struct 
flow_wildcards *wc,
         }
         if (is_ip_any(flow)) {
             memset(&wc->masks.nw_proto, 0xff, sizeof wc->masks.nw_proto);
-            memset(&wc->masks.tp_src, 0xff, sizeof wc->masks.tp_src);
-            memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
+            if (flow->nw_proto != IPPROTO_ICMP) {
+                memset(&wc->masks.tp_src, 0xff, sizeof wc->masks.tp_src);
+                memset(&wc->masks.tp_dst, 0xff, sizeof wc->masks.tp_dst);
+            } else {
+                wc->masks.tp_src = htons(0xff);
+                wc->masks.tp_dst = htons(0xff);
+            }
         }
         wc->masks.vlan_tci |= htons(VLAN_VID_MASK | VLAN_CFI);
         break;
-- 
1.8.1.2

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to