flow: Don't assume non-IPv4 is IPv6 for un-wildcarding.
authorJustin Pettit <jpettit@nicira.com>
Fri, 28 Jun 2013 18:31:48 +0000 (11:31 -0700)
committerJustin Pettit <jpettit@nicira.com>
Sat, 29 Jun 2013 01:32:09 +0000 (18:32 -0700)
When determinining what fields to un-wildcard for the symmetric L4 hash,
don't include the IPv6 address fields if the packet isn't IPv6.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
lib/flow.c

index 1a5084b..d899d26 100644 (file)
@@ -795,7 +795,7 @@ flow_mask_hash_fields(const struct flow *flow, struct flow_wildcards *wc,
         if (flow->dl_type == htons(ETH_TYPE_IP)) {
             memset(&wc->masks.nw_src, 0xff, sizeof wc->masks.nw_src);
             memset(&wc->masks.nw_dst, 0xff, sizeof wc->masks.nw_dst);
-        } else {
+        } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) {
             memset(&wc->masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src);
             memset(&wc->masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst);
         }