* IPv6: Bug in net-next
@ 2014-01-08 13:02 François-Xavier Le Bail
2014-01-08 13:18 ` François-Xavier Le Bail
2014-01-08 14:43 ` [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME Hannes Frederic Sowa
0 siblings, 2 replies; 9+ messages in thread
From: François-Xavier Le Bail @ 2014-01-08 13:02 UTC (permalink / raw)
To: netdev; +Cc: davem
Hello,
I think there is a bug in actual net-next.
When I execute this code and press Crtl-C, all the IPv6 Link-Layer addresses are deleted.
This happened between c1ddf295f5183a5189196a8035546842caa2055a and HEAD.
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <net/if.h>
int main (int argc, char **argv)
{
struct ipv6_mreq mreq = { 0 };
int sockfd1 = socket (AF_INET6, SOCK_DGRAM, 0);
inet_pton (AF_INET6, "2a01:999::1", &mreq.ipv6mr_multiaddr);
mreq.ipv6mr_interface = if_nametoindex ("dummy0");
setsockopt (sockfd1, IPPROTO_IPV6, IPV6_JOIN_ANYCAST, &mreq, sizeof (mreq));
pause ();
}
BR,
Francois-Xavier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: IPv6: Bug in net-next
2014-01-08 13:02 IPv6: Bug in net-next François-Xavier Le Bail
@ 2014-01-08 13:18 ` François-Xavier Le Bail
2014-01-08 13:35 ` François-Xavier Le Bail
2014-01-08 14:43 ` [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME Hannes Frederic Sowa
1 sibling, 1 reply; 9+ messages in thread
From: François-Xavier Le Bail @ 2014-01-08 13:18 UTC (permalink / raw)
To: netdev; +Cc: davem
On Wed, 1/8/14, François-Xavier Le Bail <fx.lebail@yahoo.com> wrote:
> Hello,
> I think there is a bug in actual net-next.
> When I execute this code and press Crtl-C, all the IPv6
> Link-Layer addresses are deleted.
> This happened between
> c1ddf295f5183a5189196a8035546842caa2055a and HEAD.
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <net/if.h>
>
> int main (int argc, char **argv) {
> struct ipv6_mreq mreq = { 0 };
> int sockfd1 = socket (AF_INET6, SOCK_DGRAM, 0);
>
> inet_pton (AF_INET6, "2a01:999::1", &mreq.ipv6mr_multiaddr);
> mreq.ipv6mr_interface = if_nametoindex ("dummy0");
> setsockopt (sockfd1, IPPROTO_IPV6, IPV6_JOIN_ANYCAST, &mreq, sizeof (mreq));
>
> pause ();
> }
Sorry, it is not linked to this code.
I'm looking for the reason ...
BR,
Francois-Xavier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: IPv6: Bug in net-next
2014-01-08 13:18 ` François-Xavier Le Bail
@ 2014-01-08 13:35 ` François-Xavier Le Bail
2014-01-08 13:54 ` Damien Wyart
2014-01-08 14:04 ` Hannes Frederic Sowa
0 siblings, 2 replies; 9+ messages in thread
From: François-Xavier Le Bail @ 2014-01-08 13:35 UTC (permalink / raw)
To: netdev; +Cc: davem
On Wed, 1/8/14, François-Xavier Le Bail <fx.lebail@yahoo.com> wrote:
> > I think there is a bug in actual net-next.
> > When I execute this code and press Crtl-C, all the IPv6
> > Link-Layer addresses are deleted.
> > This happened between
> > c1ddf295f5183a5189196a8035546842caa2055a and HEAD.
> > [...]
> Sorry, it is not linked to this code.
> I'm looking for the reason ...
It seems that the valid lifetime and preferred lft are set to 0 sec for autoconfigured LLA.
BR,
Francois-Xavier
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: IPv6: Bug in net-next
2014-01-08 13:35 ` François-Xavier Le Bail
@ 2014-01-08 13:54 ` Damien Wyart
2014-01-08 14:04 ` Hannes Frederic Sowa
1 sibling, 0 replies; 9+ messages in thread
From: Damien Wyart @ 2014-01-08 13:54 UTC (permalink / raw)
To: François-Xavier Le Bail; +Cc: netdev, davem
> > > When I execute this code and press Crtl-C, all the IPv6 Link-Layer
> > > addresses are deleted.
> It seems that the valid lifetime and preferred lft are set to 0 sec
> for autoconfigured LLA.
I am also seeing the problem with Linus' up-to-date tree (3.13-rc7+).
On eth0, LLA is not present after boot, as well as ::1 (Host scope) on
the loopback (which causes some daemons to not start properly as they
try to listen on ::1). Manually setting these adresses with ip addr
works, they do not disappear afterwards.
--
Damien
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: IPv6: Bug in net-next
2014-01-08 13:35 ` François-Xavier Le Bail
2014-01-08 13:54 ` Damien Wyart
@ 2014-01-08 14:04 ` Hannes Frederic Sowa
2014-01-08 14:13 ` Hannes Frederic Sowa
1 sibling, 1 reply; 9+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-08 14:04 UTC (permalink / raw)
To: François-Xavier Le Bail; +Cc: netdev, davem
On Wed, Jan 08, 2014 at 05:35:39AM -0800, François-Xavier Le Bail wrote:
> On Wed, 1/8/14, François-Xavier Le Bail <fx.lebail@yahoo.com> wrote:
>
> > > I think there is a bug in actual net-next.
>
> > > When I execute this code and press Crtl-C, all the IPv6
> > > Link-Layer addresses are deleted.
>
> > > This happened between
> > > c1ddf295f5183a5189196a8035546842caa2055a and HEAD.
>
> > > [...]
>
> > Sorry, it is not linked to this code.
> > I'm looking for the reason ...
>
> It seems that the valid lifetime and preferred lft are set to 0 sec for autoconfigured LLA.
Grrr, I guess we should switch in addrconf_add_linklocal to call ipv6_add_addr
with INFINITY_LIFE_TIME preferred and valid lft. IFA_PERMANENT may now expire,
too since commit fad8da3e0 ("ipv6 addrconf: fix preferred lifetime
state-changing behavior while valid_lft is infinity").
Greetings,
Hannes
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: IPv6: Bug in net-next
2014-01-08 14:04 ` Hannes Frederic Sowa
@ 2014-01-08 14:13 ` Hannes Frederic Sowa
0 siblings, 0 replies; 9+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-08 14:13 UTC (permalink / raw)
To: François-Xavier Le Bail, netdev, davem
On Wed, Jan 08, 2014 at 03:04:00PM +0100, Hannes Frederic Sowa wrote:
> On Wed, Jan 08, 2014 at 05:35:39AM -0800, François-Xavier Le Bail wrote:
> > On Wed, 1/8/14, François-Xavier Le Bail <fx.lebail@yahoo.com> wrote:
> >
> > > > I think there is a bug in actual net-next.
> >
> > > > When I execute this code and press Crtl-C, all the IPv6
> > > > Link-Layer addresses are deleted.
> >
> > > > This happened between
> > > > c1ddf295f5183a5189196a8035546842caa2055a and HEAD.
> >
> > > > [...]
> >
> > > Sorry, it is not linked to this code.
> > > I'm looking for the reason ...
> >
> > It seems that the valid lifetime and preferred lft are set to 0 sec for autoconfigured LLA.
>
> Grrr, I guess we should switch in addrconf_add_linklocal to call ipv6_add_addr
> with INFINITY_LIFE_TIME preferred and valid lft. IFA_PERMANENT may now expire,
> too since commit fad8da3e0 ("ipv6 addrconf: fix preferred lifetime
> state-changing behavior while valid_lft is infinity").
I am testing this patch:
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 31f75ea..f7e86e3 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2528,7 +2528,8 @@ static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
struct inet6_ifaddr *ifp;
ifp = ipv6_add_addr(idev, addr, NULL, plen,
- scope, IFA_F_PERMANENT, 0, 0);
+ scope, IFA_F_PERMANENT,
+ INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
@@ -2656,7 +2657,8 @@ static void addrconf_add_linklocal(struct inet6_dev *idev, const struct in6_addr
#endif
- ifp = ipv6_add_addr(idev, addr, NULL, 64, IFA_LINK, addr_flags, 0, 0);
+ ifp = ipv6_add_addr(idev, addr, NULL, 64, IFA_LINK, addr_flags,
+ INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
if (!IS_ERR(ifp)) {
addrconf_prefix_route(&ifp->addr, ifp->prefix_len, idev->dev, 0, 0);
addrconf_dad_start(ifp);
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME
2014-01-08 13:02 IPv6: Bug in net-next François-Xavier Le Bail
2014-01-08 13:18 ` François-Xavier Le Bail
@ 2014-01-08 14:43 ` Hannes Frederic Sowa
2014-01-08 16:12 ` Damien Wyart
2014-01-10 4:09 ` David Miller
1 sibling, 2 replies; 9+ messages in thread
From: Hannes Frederic Sowa @ 2014-01-08 14:43 UTC (permalink / raw)
To: François-Xavier Le Bail; +Cc: netdev, davem, damien.wyart, yasushi.asano
In the past the IFA_PERMANENT flag indicated, that the valid and preferred
lifetime where ignored. Since change fad8da3e085ddf ("ipv6 addrconf: fix
preferred lifetime state-changing behavior while valid_lft is infinity")
we honour at least the preferred lifetime on those addresses. As such
the valid lifetime gets recalculated and updated to 0.
If loopback address is added manually this problem does not occur.
Also if NetworkManager manages IPv6, those addresses will get added via
inet6_rtm_newaddr and thus will have a correct lifetime, too.
Reported-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
Reported-by: Damien Wyart <damien.wyart@gmail.com>
Fixes: fad8da3e085ddf ("ipv6 addrconf: fix preferred lifetime state-changing behavior while valid_lft is infinity")
Cc: Yasushi Asano <yasushi.asano@jp.fujitsu.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
---
I hope there will be another pull request to Linus before 3.13 (I think
there will be an upcoming -rc8 this Sunday?).
net/ipv6/addrconf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 31f75ea..01263a1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2528,7 +2528,8 @@ static void add_addr(struct inet6_dev *idev, const struct in6_addr *addr,
struct inet6_ifaddr *ifp;
ifp = ipv6_add_addr(idev, addr, NULL, plen,
- scope, IFA_F_PERMANENT, 0, 0);
+ scope, IFA_F_PERMANENT,
+ INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
if (!IS_ERR(ifp)) {
spin_lock_bh(&ifp->lock);
ifp->flags &= ~IFA_F_TENTATIVE;
@@ -2656,7 +2657,8 @@ static void addrconf_add_linklocal(struct inet6_dev *idev, const struct in6_addr
#endif
- ifp = ipv6_add_addr(idev, addr, NULL, 64, IFA_LINK, addr_flags, 0, 0);
+ ifp = ipv6_add_addr(idev, addr, NULL, 64, IFA_LINK, addr_flags,
+ INFINITY_LIFE_TIME, INFINITY_LIFE_TIME);
if (!IS_ERR(ifp)) {
addrconf_prefix_route(&ifp->addr, ifp->prefix_len, idev->dev, 0, 0);
addrconf_dad_start(ifp);
--
1.8.4.2
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME
2014-01-08 14:43 ` [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME Hannes Frederic Sowa
@ 2014-01-08 16:12 ` Damien Wyart
2014-01-10 4:09 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: Damien Wyart @ 2014-01-08 16:12 UTC (permalink / raw)
To: François-Xavier Le Bail, netdev, davem, yasushi.asano
* Hannes Frederic Sowa <hannes@stressinduktion.org> [2014-01-08 15:43]:
> In the past the IFA_PERMANENT flag indicated, that the valid and preferred
> lifetime where ignored. Since change fad8da3e085ddf ("ipv6 addrconf: fix
> preferred lifetime state-changing behavior while valid_lft is infinity")
> we honour at least the preferred lifetime on those addresses. As such
> the valid lifetime gets recalculated and updated to 0.
> If loopback address is added manually this problem does not occur.
> Also if NetworkManager manages IPv6, those addresses will get added via
> inet6_rtm_newaddr and thus will have a correct lifetime, too.
I confirm this patch (on top of 3.13-rc7+) fixes the problem on my
system, eth0 has a LLA adress again after boot and ::1 is back on the
loopback interface.
Thanks for the quick fix!
--
Damien Wyart
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME
2014-01-08 14:43 ` [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME Hannes Frederic Sowa
2014-01-08 16:12 ` Damien Wyart
@ 2014-01-10 4:09 ` David Miller
1 sibling, 0 replies; 9+ messages in thread
From: David Miller @ 2014-01-10 4:09 UTC (permalink / raw)
To: hannes; +Cc: fx.lebail, netdev, damien.wyart, yasushi.asano
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
Date: Wed, 8 Jan 2014 15:43:22 +0100
> In the past the IFA_PERMANENT flag indicated, that the valid and preferred
> lifetime where ignored. Since change fad8da3e085ddf ("ipv6 addrconf: fix
> preferred lifetime state-changing behavior while valid_lft is infinity")
> we honour at least the preferred lifetime on those addresses. As such
> the valid lifetime gets recalculated and updated to 0.
>
> If loopback address is added manually this problem does not occur.
> Also if NetworkManager manages IPv6, those addresses will get added via
> inet6_rtm_newaddr and thus will have a correct lifetime, too.
>
> Reported-by: François-Xavier Le Bail <fx.lebail@yahoo.com>
> Reported-by: Damien Wyart <damien.wyart@gmail.com>
> Fixes: fad8da3e085ddf ("ipv6 addrconf: fix preferred lifetime state-changing behavior while valid_lft is infinity")
> Cc: Yasushi Asano <yasushi.asano@jp.fujitsu.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Applied, thanks Hannes.
> I hope there will be another pull request to Linus before 3.13 (I think
> there will be an upcoming -rc8 this Sunday?).
I think I will be able to sneak one more pull request in.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-01-10 4:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 13:02 IPv6: Bug in net-next François-Xavier Le Bail
2014-01-08 13:18 ` François-Xavier Le Bail
2014-01-08 13:35 ` François-Xavier Le Bail
2014-01-08 13:54 ` Damien Wyart
2014-01-08 14:04 ` Hannes Frederic Sowa
2014-01-08 14:13 ` Hannes Frederic Sowa
2014-01-08 14:43 ` [PATCH net] ipv6: add link-local, sit and loopback address with INFINITY_LIFE_TIME Hannes Frederic Sowa
2014-01-08 16:12 ` Damien Wyart
2014-01-10 4:09 ` 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).