Patchwork [043/106] ipv6: don't call addrconf_dst_alloc again when enable lo

mail settings
Submitter Luis Henriques
Date July 30, 2013, 9:31 a.m.
Message ID <>
Download mbox | patch
Permalink /patch/263320/
State New
Headers show


Luis Henriques - July 30, 2013, 9:31 a.m. -stable review patch.  If anyone has any objections, please let me know.


From: Gao feng <>

commit a881ae1f625c599b460cc8f8a7fcb1c438f699ad upstream.

If we disable all of the net interfaces, and enable
un-lo interface before lo interface, we already allocated
the addrconf dst in ipv6_add_addr. So we shouldn't allocate
it again when we enable lo interface.

Otherwise the message below will be triggered.
unregister_netdevice: waiting for sit1 to become free. Usage count = 1

This problem is introduced by commit 25fb6ca4ed9cad72f14f61629b68dc03c0d9713f
"net IPv6 : Fix broken IPv6 routing table after loopback down-up"

Signed-off-by: Gao feng <>
Signed-off-by: David S. Miller <>
Signed-off-by: Luis Henriques <>
 net/ipv6/addrconf.c | 3 +++
 1 file changed, 3 insertions(+)


diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 449df3f..c126b0a 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2432,6 +2432,9 @@  static void init_loopback(struct net_device *dev)
 			if (sp_ifa->flags & (IFA_F_DADFAILED | IFA_F_TENTATIVE))
+			if (sp_ifa->rt)
+				continue;
 			sp_rt = addrconf_dst_alloc(idev, &sp_ifa->addr, 0);
 			/* Failure cases are ignored */