[IPV6] NDISC: Avoid updating neighbor cache for proxied address in receiving NA.
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / ipv6 / ndisc.c
index ed01f9a330d6d6eb2900ddcf44a08be81381ee0b..0e0d6ce6902134617bb360e980c75ad9eb8cec28 100644 (file)
@@ -952,6 +952,15 @@ static void ndisc_recv_na(struct sk_buff *skb)
                if (neigh->nud_state & NUD_FAILED)
                        goto out;
 
+               /*
+                * Don't update the neighbor cache entry on a proxy NA from
+                * ourselves because either the proxied node is off link or it
+                * has already sent a NA to us.
+                */
+               if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) &&
+                   pneigh_lookup(&nd_tbl, &msg->target, dev, 0))
+                       goto out;
+
                neigh_update(neigh, lladdr,
                             msg->icmph.icmp6_solicited ? NUD_REACHABLE : NUD_STALE,
                             NEIGH_UPDATE_F_WEAK_OVERRIDE|