From: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
To: David Miller <davem@davemloft.net>
Cc: Lorenzo Colitti <lorenzo@google.com>,
netdev@vger.kernel.org, Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH] net: ipv6: Don't purge default router if accept_ra=2
Date: Mon, 04 Mar 2013 19:09:19 +0900 [thread overview]
Message-ID: <513472CF.7020308@linux-ipv6.org> (raw)
In-Reply-To: <CAKD1Yr2e8Z8CDAM3tgp=nUR58OO9QZYEx8zkWwwcQ1S=14D2Qw@mail.gmail.com>
Lorenzo Colitti wrote:
> Setting net.ipv6.conf.<interface>.accept_ra=2 causes the kernel
> to accept RAs even when forwarding is enabled. However, enabling
> forwarding purges all default routes on the system, breaking
> connectivity until the next RA is received. Fix this by not
> purging default routes on interfaces that have accept_ra=2.
>
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
> ---
> net/ipv6/route.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 9282665..e5fe004 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -1915,7 +1915,8 @@ void rt6_purge_dflt_routers(struct net *net)
> restart:
> read_lock_bh(&table->tb6_lock);
> for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) {
> - if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) {
> + if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF) &&
> + (!rt->rt6i_idev || rt->rt6i_idev->cnf.accept_ra != 2)) {
> dst_hold(&rt->dst);
> read_unlock_bh(&table->tb6_lock);
> ip6_del_rt(rt);
>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--yoshfuji
next prev parent reply other threads:[~2013-03-04 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-04 6:46 [PATCH] net: ipv6: Don't purge default router if accept_ra=2 Lorenzo Colitti
2013-03-04 10:09 ` YOSHIFUJI Hideaki [this message]
2013-03-04 14:58 ` Eric Dumazet
2013-03-04 19:15 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513472CF.7020308@linux-ipv6.org \
--to=yoshfuji@linux-ipv6.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=lorenzo@google.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.