netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: honor ifindex in case we receive ll addresses in router advertisements
@ 2015-12-23 21:44 Hannes Frederic Sowa
  2015-12-24  3:05 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Frederic Sowa @ 2015-12-23 21:44 UTC (permalink / raw)
  To: netdev; +Cc: Marc Haber

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>
---
 net/ipv6/ndisc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index d6161e1c48c86f..84afb9a7727848 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1183,7 +1183,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
 	 */
 	if (!in6_dev->cnf.accept_ra_from_local &&
 	    ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr,
-			  NULL, 0)) {
+			  in6_dev->dev, 0)) {
 		ND_PRINTK(2, info,
 			  "RA from local address detected on dev: %s: default router ignored\n",
 			  skb->dev->name);
@@ -1337,7 +1337,7 @@ skip_linkparms:
 #ifdef CONFIG_IPV6_ROUTE_INFO
 	if (!in6_dev->cnf.accept_ra_from_local &&
 	    ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr,
-			  NULL, 0)) {
+			  in6_dev->dev, 0)) {
 		ND_PRINTK(2, info,
 			  "RA from local address detected on dev: %s: router info ignored.\n",
 			  skb->dev->name);
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] ipv6: honor ifindex in case we receive ll addresses in router advertisements
  2015-12-23 21:44 [PATCH net] ipv6: honor ifindex in case we receive ll addresses in router advertisements Hannes Frederic Sowa
@ 2015-12-24  3:05 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-12-24  3:05 UTC (permalink / raw)
  To: hannes; +Cc: netdev, mh+netdev

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Wed, 23 Dec 2015 22:44:37 +0100

> 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>

Applied, thanks Hannes.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-24  3:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-23 21:44 [PATCH net] ipv6: honor ifindex in case we receive ll addresses in router advertisements Hannes Frederic Sowa
2015-12-24  3:05 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).