linux/drivers/net/bonding
Weiping Pan 7d26bb103c bonding: emit event when bonding changes MAC
When a bonding device is configured with fail_over_mac=active,
we expect to see the MAC address of the new active slave as the source MAC
address after failover. But we see that the source MAC address is the MAC
address of previous active slave.

Emit NETDEV_CHANGEADDR event when bonding changes its MAC address, in order
to let arp_netdev_event flush neighbour cache and route cache.

How to reproduce this bug ?

                       -----------hostB----------------
hostA ----- switch ---|-- eth0--bond0(192.168.100.2/24)|
(192.168.100.1/24  \--|-- eth1-/                       |
                       --------------------------------

1 on hostB,
modprobe bonding mode=1 miimon=500 fail_over_mac=active downdelay=1000
num_grat_arp=1
ifconfig bond0 192.168.100.2/24 up
ifenslave bond0 eth0
ifenslave bond0 eth1

then eth0 is the active slave, and MAC of bond0 is MAC of eth0.

2 on hostA, ping 192.168.100.2

3 on hostB,
tcpdump -i bond0 -p icmp -XXX
you will see bond0 uses MAC of eth0 as source MAC in icmp reply.

4 on hostB,
ifconfig eth0 down
tcpdump -i bond0 -p icmp -XXX (just keep it running in step 3)
you will see first bond0 uses MAC of eth1 as source MAC in icmp
reply, then it will use MAC of eth0 as source MAC.

Signed-off-by: Weiping Pan <wpan@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-03-29 18:11:57 -04:00
..
bond_3ad.c bonding: Fix misspelling of "since" 2012-02-05 22:42:00 -05:00
bond_3ad.h bonding: delete unused ad_timer 2011-06-09 15:02:19 -07:00
bond_alb.c drivers/net: Remove unnecessary k.alloc/v.alloc OOM messages 2012-01-31 16:20:21 -05:00
bond_alb.h bonding: move processing of recv handlers into handle_frame() 2011-04-25 12:00:30 -07:00
bond_debugfs.c bonding: add the debugfs interface to see RLB hash table 2010-12-16 13:16:05 -08:00
bond_main.c bonding: emit event when bonding changes MAC 2012-03-29 18:11:57 -04:00
bond_procfs.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2011-11-07 10:55:33 -08:00
bond_sysfs.c Merge branch 'driver-core-next' into Linux 3.2 2012-01-06 11:42:52 -08:00
bonding.h bonding: remove entries for master_ip and vlan_ip and query devices instead 2012-03-22 22:36:17 -04:00
Makefile bonding, ipv4, ipv6, vlan: Handle NETDEV_BONDING_FAILOVER like NETDEV_NOTIFY_PEERS 2011-04-17 23:36:03 -07:00