tnl-neigh-cache: ignore Neighbor Advertisements with no TLL
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Fri, 19 Feb 2016 16:42:13 +0000 (14:42 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@redhat.com>
Thu, 10 Mar 2016 17:03:57 +0000 (14:03 -0300)
RFC4861 says Neighbor Advertisements sent in response to unicast Neighbor
Solicitations SHOULD include the Target link-layer address. However, Linux
doesn't. Responses to multicast NS MUST include it, which is what OVS sends. So,
the response to Solicitations sent by OVS will include the TLL address and other
Advertisements not including it can be ignored.

This prevents the inclusion of a zero address in the cache.

lib/tnl-neigh-cache.c

index 0339b52..29a70a3 100644 (file)
@@ -171,6 +171,10 @@ tnl_nd_snoop(const struct flow *flow, struct flow_wildcards *wc,
         return EINVAL;
     }
 
+    if (eth_addr_is_zero(flow->arp_tha)) {
+        return EINVAL;
+    }
+
     memset(&wc->masks.ipv6_src, 0xff, sizeof wc->masks.ipv6_src);
     memset(&wc->masks.ipv6_dst, 0xff, sizeof wc->masks.ipv6_dst);
     memset(&wc->masks.nd_target, 0xff, sizeof wc->masks.nd_target);