diff mbox

[ipv6,1/1] ipv6: addrconf: do addrconf_ifdown when last ipv6 address is removed

Message ID 1434619742-10423-2-git-send-email-ranamazharp@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Mazhar Rana June 18, 2015, 9:29 a.m. UTC
After 'commit 876fd05ddbae03166e7037fca957b55bb3be6594
("ipv6: don't disable interface if last ipv6 address is removed")'
it is not clearing ipv6 interface configurations(routes, neighbours,
etc) when last ipv6 address of interface is removed.

This patch will call addrconf_ifdown when last ipv6 address of
interface is removed to clear ipv6 interface configurations. This will
not delete /proc/sys/net/ipv6/conf/<interface> directory.

Signed-off-by: Mazhar Rana <mazhar.rana@cyberoam.com>
Acked-by: Sanket Shah <sanket.shah@cyberoam.com>
---
 net/ipv6/addrconf.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 37b70e8..230452c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2678,6 +2678,8 @@  static int inet6_addr_del(struct net *net, int ifindex, u32 ifa_flags,
 				ipv6_mc_config(net->ipv6.mc_autojoin_sk,
 					       false, pfx, dev->ifindex);
 			}
+			if (list_empty(&idev->addr_list))
+				addrconf_ifdown(idev->dev, 0);
 			return 0;
 		}
 	}