aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2015-12-23 16:44:37 -0500
committerDavid S. Miller <davem@davemloft.net>2015-12-23 22:03:54 -0500
commitc1a9a291cee0890eb0f435243f3fb84fefb04348 (patch)
tree19edc956da56ffdef71137e831f52934f927581b
parent5449a5ca9bc27dd51a462de7ca0b1cd861cd2bd0 (diff)
ipv6: honor ifindex in case we receive ll addresses in router advertisements
Marc Haber reported we don't honor interface indexes when we receive link local router addresses in router advertisements. Luckily the non-strict version of ipv6_chk_addr already does the correct job here, so we can simply use it to lighten the checks and use those addresses by default without any configuration change. Link: <http://permalink.gmane.org/gmane.linux.network/391348> Reported-by: Marc Haber <mh+netdev@zugschlus.de> Cc: Marc Haber <mh+netdev@zugschlus.de> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/ndisc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d6161e1c48c8..84afb9a77278 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1183,7 +1183,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
1183 */ 1183 */
1184 if (!in6_dev->cnf.accept_ra_from_local && 1184 if (!in6_dev->cnf.accept_ra_from_local &&
1185 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, 1185 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr,
1186 NULL, 0)) { 1186 in6_dev->dev, 0)) {
1187 ND_PRINTK(2, info, 1187 ND_PRINTK(2, info,
1188 "RA from local address detected on dev: %s: default router ignored\n", 1188 "RA from local address detected on dev: %s: default router ignored\n",
1189 skb->dev->name); 1189 skb->dev->name);
@@ -1337,7 +1337,7 @@ skip_linkparms:
1337#ifdef CONFIG_IPV6_ROUTE_INFO 1337#ifdef CONFIG_IPV6_ROUTE_INFO
1338 if (!in6_dev->cnf.accept_ra_from_local && 1338 if (!in6_dev->cnf.accept_ra_from_local &&
1339 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, 1339 ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr,
1340 NULL, 0)) { 1340 in6_dev->dev, 0)) {
1341 ND_PRINTK(2, info, 1341 ND_PRINTK(2, info,
1342 "RA from local address detected on dev: %s: router info ignored.\n", 1342 "RA from local address detected on dev: %s: router info ignored.\n",
1343 skb->dev->name); 1343 skb->dev->name);