diff mbox

ipv6: add special mode forwarding=2 to send RS while configured as router

Message ID 20100903130420.GB28460@bombadil.infradead.org
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Thomas Graf Sept. 3, 2010, 1:04 p.m. UTC
Similar to accepting router advertisement, the IPv6 stack does not send router
solicitations if forwarding is enabled.

This patch enables this behavior to be overruled by setting forwarding to the
special value 2.

Signed-off-by: Thomas Graf <tgraf@infradead.org>

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

stephen hemminger Sept. 3, 2010, 3 p.m. UTC | #1
On Fri, 3 Sep 2010 09:04:20 -0400
Thomas Graf <tgraf@infradead.org> wrote:

> Similar to accepting router advertisement, the IPv6 stack does not send router
> solicitations if forwarding is enabled.
> 
> This patch enables this behavior to be overruled by setting forwarding to the
> special value 2.
> 
> Signed-off-by: Thomas Graf <tgraf@infradead.org>
> 

Please add description to Documentation/networking/ip-sysctl.txt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Sept. 3, 2010, 4:43 p.m. UTC | #2
From: Thomas Graf <tgraf@infradead.org>
Date: Fri, 3 Sep 2010 09:04:20 -0400

> Similar to accepting router advertisement, the IPv6 stack does not send router
> solicitations if forwarding is enabled.
> 
> This patch enables this behavior to be overruled by setting forwarding to the
> special value 2.
> 
> Signed-off-by: Thomas Graf <tgraf@infradead.org>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Roesen Nov. 24, 2010, 6:03 p.m. UTC | #3
Hi,

On Fri, Sep 03, 2010 at 09:04:20AM -0400, Thomas Graf wrote:
> Similar to accepting router advertisement, the IPv6 stack does not send router
> solicitations if forwarding is enabled.
> 
> This patch enables this behavior to be overruled by setting forwarding to the
> special value 2.

Wouldn't it be more elegant to use accept_ra=2 as trigger instead of a new special
value for the forwarding option?

Best regards,
Daniel
Thomas Graf Dec. 6, 2010, 11:26 a.m. UTC | #4
On Wed, Nov 24, 2010 at 07:03:06PM +0100, Daniel Roesen wrote:
> On Fri, Sep 03, 2010 at 09:04:20AM -0400, Thomas Graf wrote:
> > Similar to accepting router advertisement, the IPv6 stack does not send router
> > solicitations if forwarding is enabled.
> > 
> > This patch enables this behavior to be overruled by setting forwarding to the
> > special value 2.
> 
> Wouldn't it be more elegant to use accept_ra=2 as trigger instead of a new special
> value for the forwarding option?

Two reasons: I didn't want to change the behaviour of an existing
configuration option on which someone may rely on and I wanted to
allow sending of RS while still allowing to disable accepting RAs.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

Index: net-2.6/net/ipv6/addrconf.c
===================================================================
--- net-2.6.orig/net/ipv6/addrconf.c
+++ net-2.6/net/ipv6/addrconf.c
@@ -2964,7 +2964,8 @@  static void addrconf_dad_completed(struc
 	   start sending router solicitations.
 	 */
 
-	if (ifp->idev->cnf.forwarding == 0 &&
+	if ((ifp->idev->cnf.forwarding == 0 ||
+	     ifp->idev->cnf.forwarding == 2) &&
 	    ifp->idev->cnf.rtr_solicits > 0 &&
 	    (dev->flags&IFF_LOOPBACK) == 0 &&
 	    (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) {