From: David Miller <davem@davemloft.net>
To: nicolas.dichtel@6wind.com
Cc: netdev@vger.kernel.org, Balakumaran.Kannan@ap.sony.com,
Maruthi.Thotad@ap.sony.com, sd@queasysnail.net,
hannes@stressinduktion.org, chenweilong@huawei.com,
gaofeng@cn.fujitsu.com
Subject: Re: [PATCH net] ipv6: correctly add local routes when lo goes up
Date: Fri, 14 Oct 2016 10:06:34 -0400 (EDT) [thread overview]
Message-ID: <20161014.100634.1750361454408261153.davem@davemloft.net> (raw)
In-Reply-To: <1476259840-26261-1-git-send-email-nicolas.dichtel@6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Wed, 12 Oct 2016 10:10:40 +0200
> The goal of the patch is to fix this scenario:
> ip link add dummy1 type dummy
> ip link set dummy1 up
> ip link set lo down ; ip link set lo up
>
> After that sequence, the local route to the link layer address of dummy1 is
> not there anymore.
>
> When the loopback is set down, all local routes are deleted by
> addrconf_ifdown()/rt6_ifdown(). At this time, the rt6_info entry still
> exists, because the corresponding idev has a reference on it. After the rcu
> grace period, dst_rcu_free() is called, and thus ___dst_free(), which will
> set obsolete to DST_OBSOLETE_DEAD.
>
> In this case, init_loopback() is called before dst_rcu_free(), thus
> obsolete is still sets to something <= 0. So, the function doesn't add the
> route again. To avoid that race, let's check the rt6 refcnt instead.
>
> Fixes: 25fb6ca4ed9c ("net IPv6 : Fix broken IPv6 routing table after loopback down-up")
> Fixes: a881ae1f625c ("ipv6: don't call addrconf_dst_alloc again when enable lo")
> Fixes: 33d99113b110 ("ipv6: reallocate addrconf router for ipv6 address when lo device up")
> Reported-by: Francesco Santoro <francesco.santoro@6wind.com>
> Reported-by: Samuel Gauthier <samuel.gauthier@6wind.com>
...
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2016-10-14 14:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-12 8:10 [PATCH net] ipv6: correctly add local routes when lo goes up Nicolas Dichtel
2016-10-14 14:06 ` David Miller [this message]
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=20161014.100634.1750361454408261153.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Balakumaran.Kannan@ap.sony.com \
--cc=Maruthi.Thotad@ap.sony.com \
--cc=chenweilong@huawei.com \
--cc=gaofeng@cn.fujitsu.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=sd@queasysnail.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox