Commit a61e73fd authored by Ville Nuorvala's avatar Ville Nuorvala Committed by David S. Miller

[IPV6]: Protect proxied addresses against DAD.

parent 63692ed2
...@@ -861,7 +861,8 @@ static void ndisc_recv_ns(struct sk_buff *skb) ...@@ -861,7 +861,8 @@ static void ndisc_recv_ns(struct sk_buff *skb)
struct inet6_dev *in6_dev = in6_dev_get(dev); struct inet6_dev *in6_dev = in6_dev_get(dev);
if (in6_dev && in6_dev->cnf.forwarding && if (in6_dev && in6_dev->cnf.forwarding &&
(addr_type & IPV6_ADDR_UNICAST) && (addr_type & IPV6_ADDR_UNICAST ||
addr_type == IPV6_ADDR_ANY) &&
pneigh_lookup(&nd_tbl, &msg->target, dev, 0)) { pneigh_lookup(&nd_tbl, &msg->target, dev, 0)) {
int inc = ipv6_addr_type(daddr)&IPV6_ADDR_MULTICAST; int inc = ipv6_addr_type(daddr)&IPV6_ADDR_MULTICAST;
...@@ -874,6 +875,7 @@ static void ndisc_recv_ns(struct sk_buff *skb) ...@@ -874,6 +875,7 @@ static void ndisc_recv_ns(struct sk_buff *skb)
else else
nd_tbl.stats.rcv_probes_ucast++; nd_tbl.stats.rcv_probes_ucast++;
if (addr_type & IPV6_ADDR_UNICAST) {
neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev); neigh = neigh_event_ns(&nd_tbl, lladdr, saddr, dev);
if (neigh) { if (neigh) {
...@@ -881,6 +883,13 @@ static void ndisc_recv_ns(struct sk_buff *skb) ...@@ -881,6 +883,13 @@ static void ndisc_recv_ns(struct sk_buff *skb)
0, 1, 0, 1); 0, 1, 0, 1);
neigh_release(neigh); neigh_release(neigh);
} }
} else {
/* proxy should also protect against DAD */
struct in6_addr maddr;
ipv6_addr_all_nodes(&maddr);
ndisc_send_na(dev, NULL, &maddr, &msg->target,
0, 0, 0, 1);
}
} else { } else {
struct sk_buff *n = skb_clone(skb, GFP_ATOMIC); struct sk_buff *n = skb_clone(skb, GFP_ATOMIC);
if (n) if (n)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment