linux/drivers/net/bonding
Nicolas Dichtel 984ff7a3e0 rtnl/bond: don't send rtnl msg for unregistered iface
[ Upstream commit ed2a80ab7b ]

Before the patch, the command 'ip link add bond2 type bond mode 802.3ad'
causes the kernel to send a rtnl message for the bond2 interface, with an
ifindex 0.

'ip monitor' shows:
0: bond2: <BROADCAST,MULTICAST,MASTER> mtu 1500 state DOWN group default
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
9: bond2@NONE: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default
    link/ether ea:3e:1f:53:92:7b brd ff:ff:ff:ff:ff:ff
[snip]

The patch fixes the spotted bug by checking in bond driver if the interface
is registered before calling the notifier chain.
It also adds a check in rtmsg_ifinfo() to prevent this kind of bug in the
future.

Fixes: d4261e5650 ("bonding: create netlink event when bonding option is changed")
CC: Jiri Pirko <jiri@resnulli.us>
Reported-by: Julien Meunier <julien.meunier@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
History 2015-06-15 14:26:49 -04:00
..
bond_3ad.c bonding: Simplify the xmit function for modes that use xmit_hash 2014-10-06 17:13:07 -04:00
bond_3ad.h bonding: 3ad: convert to bond->mode_lock 2014-09-13 16:29:07 -04:00
bond_alb.c vlan: kill vlan_put_tag helper 2015-04-27 16:48:33 -04:00
bond_alb.h bonding: Simplify the xmit function for modes that use xmit_hash 2014-10-06 17:13:07 -04:00
bond_debugfs.c bonding: trivial: style and comment fixes 2014-09-15 17:19:49 -04:00
bond_main.c vlan: rename __vlan_put_tag to vlan_insert_tag_set_proto 2015-04-27 16:48:33 -04:00
bond_netlink.c bond: Check length of IFLA_BOND_ARP_IP_TARGET attributes 2014-11-29 20:46:32 -08:00
bond_options.c rtnl/bond: don't send rtnl msg for unregistered iface 2015-06-15 14:26:49 -04:00
bond_options.h bonding: make a generic sysfs option store and fix comments 2014-05-09 16:12:51 -04:00
bond_procfs.c bonding: display xmit_hash_policy for non-dynamic-tlb mode 2014-10-06 17:13:07 -04:00
bond_sysfs.c bonding: trivial: style and comment fixes 2014-09-15 17:19:49 -04:00
bond_sysfs_slave.c treewide: Fix typo in printk 2014-08-26 09:35:54 +02:00
bonding.h bonding: Simplify the xmit function for modes that use xmit_hash 2014-10-06 17:13:07 -04:00
Makefile bonding: add sysfs /slave dir for bond slave devices. 2014-01-17 18:51:58 -08:00