|
@@ -1221,6 +1221,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
|
|
|
if (!in6_dev->cnf.accept_ra_defrtr)
|
|
|
goto skip_defrtr;
|
|
|
|
|
|
+ if (ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, NULL, 0))
|
|
|
+ goto skip_defrtr;
|
|
|
+
|
|
|
lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime);
|
|
|
|
|
|
#ifdef CONFIG_IPV6_ROUTER_PREF
|
|
@@ -1343,6 +1346,9 @@ skip_linkparms:
|
|
|
goto out;
|
|
|
|
|
|
#ifdef CONFIG_IPV6_ROUTE_INFO
|
|
|
+ if (ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, NULL, 0))
|
|
|
+ goto skip_routeinfo;
|
|
|
+
|
|
|
if (in6_dev->cnf.accept_ra_rtr_pref && ndopts.nd_opts_ri) {
|
|
|
struct nd_opt_hdr *p;
|
|
|
for (p = ndopts.nd_opts_ri;
|
|
@@ -1360,6 +1366,8 @@ skip_linkparms:
|
|
|
&ipv6_hdr(skb)->saddr);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+skip_routeinfo:
|
|
|
#endif
|
|
|
|
|
|
#ifdef CONFIG_IPV6_NDISC_NODETYPE
|