linux/drivers/net
Nikolay Aleksandrov 9ec7eb60dc bonding: restore IFF_MASTER/SLAVE flags on bond enslave ether type change
Add bond_ether_setup helper which is used to fix ether_setup() calls in the
bonding driver. It takes care of both IFF_MASTER and IFF_SLAVE flags, the
former is always restored and the latter only if it was set.
If the bond enslaves non-ARPHRD_ETHER device (changes its type), then
releases it and enslaves ARPHRD_ETHER device (changes back) then we
use ether_setup() to restore the bond device type but it also resets its
flags and removes IFF_MASTER and IFF_SLAVE[1]. Use the bond_ether_setup
helper to restore both after such transition.

[1] reproduce (nlmon is non-ARPHRD_ETHER):
 $ ip l add nlmon0 type nlmon
 $ ip l add bond2 type bond mode active-backup
 $ ip l set nlmon0 master bond2
 $ ip l set nlmon0 nomaster
 $ ip l add bond1 type bond
 (we use bond1 as ARPHRD_ETHER device to restore bond2's mode)
 $ ip l set bond1 master bond2
 $ ip l sh dev bond2
 37: bond2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether be:d7:c5:40:5b:cc brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1500
 (notice bond2's IFF_MASTER is missing)

Fixes: e36b9d16c6 ("bonding: clean muticast addresses when device changes type")
Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-03-17 07:56:41 +00:00
..
appletalk
arcnet
bonding bonding: restore IFF_MASTER/SLAVE flags on bond enslave ether type change 2023-03-17 07:56:41 +00:00
caif
can net: Use of_property_read_bool() for boolean properties 2023-03-16 17:41:28 +00:00
dsa net: dsa: microchip: fix RGMII delay configuration on KSZ8765/KSZ8794/KSZ8795 2023-03-16 21:23:07 -07:00
ethernet net: renesas: rswitch: Fix GWTSDIE register handling 2023-03-17 07:50:50 +00:00
fddi
fjes
hamradio
hippi
hyperv Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
ieee802154 ca8210: fix mac_len negative array access 2023-03-02 14:39:48 +01:00
ipa net: ipa: fix some register validity checks 2023-03-16 21:33:18 -07:00
ipvlan ipvlan: Make skb->skb_iif track skb->dev for l3s mode 2023-03-10 21:27:15 -08:00
mctp
mdio net: dsa: seville: ignore mscc-miim read errors from Lynx PCS 2023-02-26 18:31:37 +00:00
netdevsim bpf-next-for-netdev 2023-02-10 17:51:27 -08:00
pcs net: pcs: rzn1-miic: remove unused struct members and use miic variable 2023-02-09 22:47:16 -08:00
phy net: phy: mscc: fix deadlock in phy_ethtool_{get,set}_wol() 2023-03-15 21:33:22 -07:00
plip
ppp
pse-pd
slip
team
thunderbolt
usb net: usb: smsc75xx: Move packet length check to prevent kernel panic in skb_pull 2023-03-16 17:27:56 -07:00
vmxnet3 vmxnet3: move rss code block under eop descriptor 2023-02-09 22:50:46 -08:00
vxlan
wan net: Use of_property_read_bool() for boolean properties 2023-03-16 17:41:28 +00:00
wireguard cpumask: fix incorrect cpumask scanning result checks 2023-03-06 12:15:13 -08:00
wireless net: Use of_property_read_bool() for boolean properties 2023-03-16 17:41:28 +00:00
wwan net: wwan: t7xx: Fix Runtime PM initialization 2023-01-28 13:20:21 +00:00
xen-netback Including fixes from wireless and netfilter. 2023-02-27 14:05:08 -08:00
Kconfig Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
LICENSE.SRC
Makefile
Space.c
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
loopback.c
macsec.c Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
macvlan.c
macvtap.c
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c tap: tap_open(): correctly initialize socket uid 2023-02-06 10:16:55 +00:00
tun.c bpf-next-for-netdev 2023-02-10 17:51:27 -08:00
veth.c veth: Fix use after free in XDP_REDIRECT 2023-03-15 21:11:06 -07:00
virtio_net.c virtio_net: free xdp shinfo frags when build_skb_from_xdp_buff() fails 2023-03-16 17:46:05 +00:00
vrf.c
vsockmon.c
xen-netfront.c drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00