lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 8 Jan 2009 17:14:15 -0800
From:	Stephen Hemminger <shemminger@...tta.com>
To:	David Miller <davem@...emloft.net>, yoshfuji@...ux-ipv6.org
Cc:	netdev@...r.kernel.org
Subject: [PATCH] ipv6: address preservation on link down

When an interface goes down, IPV6 deletes all addresses unlike IPV4. This
is a problem since it can break routing protocols and other applications.
It looks like this was done to handle DAD, but is a big stick solution when
other code is possible.

The following patch changes the behaviour to delete link local addresses
but keep all configured addresses and restart DAD when interface comes back up.

See also: https://kerneltrap.org/mailarchive/linux-netdev/2008/3/25/1252064/thread

Signed-off-by: Stephen Hemminger <shemminger@...tta.com>


--- a/net/ipv6/addrconf.c	2009-01-08 16:43:04.921305933 -0800
+++ b/net/ipv6/addrconf.c	2009-01-08 16:47:04.000301344 -0800
@@ -2678,18 +2678,26 @@ static int addrconf_ifdown(struct net_de
 		write_lock_bh(&idev->lock);
 	}
 #endif
-	while ((ifa = idev->addr_list) != NULL) {
-		idev->addr_list = ifa->if_next;
-		ifa->if_next = NULL;
-		ifa->dead = 1;
-		addrconf_del_timer(ifa);
-		write_unlock_bh(&idev->lock);
-
-		__ipv6_ifa_notify(RTM_DELADDR, ifa);
-		atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);
-		in6_ifa_put(ifa);
-
-		write_lock_bh(&idev->lock);
+	/* clear regular address list on removal */
+	bifa = &idev->addr_list;
+	while ((ifa = *bifa) != NULL) {
+		if (how || (ipv6_addr_type(&ifa->addr) & IPV6_ADDR_LINKLOCAL)) {
+			*bifa = ifa->if_next;
+			ifa->if_next = NULL;
+			ifa->dead = 1;
+			addrconf_del_timer(ifa);
+			write_unlock_bh(&idev->lock);
+
+			__ipv6_ifa_notify(RTM_DELADDR, ifa);
+			atomic_notifier_call_chain(&inet6addr_chain, NETDEV_DOWN, ifa);
+			in6_ifa_put(ifa);
+
+			write_lock_bh(&idev->lock);
+		} else {
+			/* Force duplicate address detection when link resumes */
+			ifa->flags |= IFA_F_TENTATIVE;
+			bifa = &ifa->if_next;
+		}
 	}
 	write_unlock_bh(&idev->lock);
 
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ