netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6: no addrconf for slave devices
@ 2015-10-16 10:21 Jan Blunck
  2015-10-16 11:54 ` Jiri Pirko
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Blunck @ 2015-10-16 10:21 UTC (permalink / raw)
  To: davem, kuznet, jmorris, yoshfuji, kaber; +Cc: netdev, linux-kernel, fubar, jiri

If a device without the IFF_SLAVE flag set (e.g. team, bridge, openvswitch
vport, batman) is enslaved and IPv6 is active then addrconf will be
initiated and a link-local address is added to the slave interface.

This patch alters the behavior so that addrconf will only run on the master
device itself. This is achieved by checking the device tree instead of
checking for a specific flag.

Signed-off-by: Jan Blunck <jblunck@infradead.org>
---
 net/ipv6/addrconf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 9001133..26d61f0 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -3141,8 +3141,12 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 
 	case NETDEV_UP:
 	case NETDEV_CHANGE:
-		if (dev->flags & IFF_SLAVE)
+		/* If a master is set stop IPv6 on this interface */
+		if (netdev_master_upper_dev_get(dev)) {
+			if (idev)
+				addrconf_ifdown(dev, 1);
 			break;
+		}
 
 		if (idev && idev->cnf.disable_ipv6)
 			break;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-10-16 16:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16 10:21 [PATCH] ipv6: no addrconf for slave devices Jan Blunck
2015-10-16 11:54 ` Jiri Pirko
2015-10-16 12:19   ` Hannes Frederic Sowa
2015-10-16 15:57   ` Jan Blunck
2015-10-16 16:02     ` David Ahern
2015-10-16 16:12       ` Jan Blunck
2015-10-16 16:14         ` David Ahern
2015-10-16 16:36           ` Jan Blunck

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).