netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] bonding: fix bond dev flags after convert to arphrd_ether
@ 2015-07-15 20:09 Nikolay Aleksandrov
  2015-07-15 20:32 ` Jay Vosburgh
  2015-07-15 20:55 ` Nikolay Aleksandrov
  0 siblings, 2 replies; 8+ messages in thread
From: Nikolay Aleksandrov @ 2015-07-15 20:09 UTC (permalink / raw)
  To: netdev; +Cc: monis, j.vosburgh, gospo, vfalico, davem, Nikolay Aleksandrov

From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>

If a bonding device enslaves devices != arphrd_ether it'll change types
and if later these devices are released, it can enslave an arphrd_ether
device and switch back calling ether_setup() which resets dev->flags to
IFF_BROADCAST|IFF_MULTICAST and clears IFF_MASTER which then could lead
to many different bugs. This bug seems to have been there since the
introduction of ether_setup() in bond_enslave().

Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: e36b9d16c6a6 ("bonding: clean muticast addresses when device changes type")
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 317a49480475..8ba119896e55 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1368,6 +1368,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
 				bond_setup_by_slave(bond_dev, slave_dev);
 			else {
 				ether_setup(bond_dev);
+				bond_dev->flags |= IFF_MASTER;
 				bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
 			}
 
-- 
1.9.3

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

end of thread, other threads:[~2015-08-28 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-15 20:09 [PATCH net] bonding: fix bond dev flags after convert to arphrd_ether Nikolay Aleksandrov
2015-07-15 20:32 ` Jay Vosburgh
2015-07-15 20:34   ` Nikolay Aleksandrov
2015-08-28  2:07   ` Nikolay Aleksandrov
2015-08-28  3:39     ` Jay Vosburgh
2015-08-28 17:38       ` Nikolay Aleksandrov
2015-07-15 20:55 ` Nikolay Aleksandrov
2015-07-20 20:01   ` 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).