netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv
@ 2013-11-26  7:46 Duan Jiong
  2013-11-29  6:09 ` Hannes Frederic Sowa
  0 siblings, 1 reply; 3+ messages in thread
From: Duan Jiong @ 2013-11-26  7:46 UTC (permalink / raw)
  To: David Miller; +Cc: netdev


when dealing with a RA message, if accept_ra_defrtr is false,
the kernel will not add the default route, and then deal with
the following route information options. Unfortunately, those
options maybe contain default route, so let's judge the
accept_ra_defrtr before calling rt6_route_rcv.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
 net/ipv6/ndisc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 3512177..3008651 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1277,6 +1277,9 @@ skip_linkparms:
 			    ri->prefix_len == 0)
 				continue;
 #endif
+			if (ri->prefix_len == 0 &&
+			    !in6_dev->cnf.accept_ra_defrtr)
+				continue;
 			if (ri->prefix_len > in6_dev->cnf.accept_ra_rt_info_max_plen)
 				continue;
 			rt6_route_rcv(skb->dev, (u8*)p, (p->nd_opt_len) << 3,
-- 
1.8.3.1

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

* Re: [PATCH] ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv
  2013-11-26  7:46 [PATCH] ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv Duan Jiong
@ 2013-11-29  6:09 ` Hannes Frederic Sowa
  2013-12-02 21:01   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Frederic Sowa @ 2013-11-29  6:09 UTC (permalink / raw)
  To: Duan Jiong; +Cc: David Miller, netdev

On Tue, Nov 26, 2013 at 03:46:56PM +0800, Duan Jiong wrote:
> 
> when dealing with a RA message, if accept_ra_defrtr is false,
> the kernel will not add the default route, and then deal with
> the following route information options. Unfortunately, those
> options maybe contain default route, so let's judge the
> accept_ra_defrtr before calling rt6_route_rcv.
> 
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>

I am ambivalent regarding this change.

accept_ra_defrtr protected against adding default routers without routing
options and accept_ra_rt_info_max_plen == -1 disables the acceptance of any
routing options in router advertisments.

I don't have an idea why we need this distinction altough I once used it for
testing. But because this change makes it more understandable for users I am
ok with that.

Greetings,

  Hannes

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

* Re: [PATCH] ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv
  2013-11-29  6:09 ` Hannes Frederic Sowa
@ 2013-12-02 21:01   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2013-12-02 21:01 UTC (permalink / raw)
  To: hannes; +Cc: duanj.fnst, netdev

From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Fri, 29 Nov 2013 07:09:45 +0100

> On Tue, Nov 26, 2013 at 03:46:56PM +0800, Duan Jiong wrote:
>> 
>> when dealing with a RA message, if accept_ra_defrtr is false,
>> the kernel will not add the default route, and then deal with
>> the following route information options. Unfortunately, those
>> options maybe contain default route, so let's judge the
>> accept_ra_defrtr before calling rt6_route_rcv.
>> 
>> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> 
> I am ambivalent regarding this change.
> 
> accept_ra_defrtr protected against adding default routers without routing
> options and accept_ra_rt_info_max_plen == -1 disables the acceptance of any
> routing options in router advertisments.
> 
> I don't have an idea why we need this distinction altough I once used it for
> testing. But because this change makes it more understandable for users I am
> ok with that.

I've applied this, thanks everyone.

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

end of thread, other threads:[~2013-12-02 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26  7:46 [PATCH] ipv6: judge the accept_ra_defrtr before calling rt6_route_rcv Duan Jiong
2013-11-29  6:09 ` Hannes Frederic Sowa
2013-12-02 21:01   ` 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).