• WANG Cong's avatar
    bonding: avoid NETDEV_CHANGEMTU event when unregistering slave · f51048c3
    WANG Cong authored
    As Hongjun/Nicolas summarized in their original patch:
    
    "
    When a device changes from one netns to another, it's first unregistered,
    then the netns reference is updated and the dev is registered in the new
    netns. Thus, when a slave moves to another netns, it is first
    unregistered. This triggers a NETDEV_UNREGISTER event which is caught by
    the bonding driver. The driver calls bond_release(), which calls
    dev_set_mtu() and thus triggers NETDEV_CHANGEMTU (the device is still in
    the old netns).
    "
    
    This is a very special case, because the device is being unregistered
    no one should still care about the NETDEV_CHANGEMTU event triggered
    at this point, we can avoid broadcasting this event on this path,
    and avoid touching inetdev_event()/addrconf_notify() path.
    
    It requires to export __dev_set_mtu() to bonding driver.
    Reported-by: default avatarHongjun Li <hongjun.li@6wind.com>
    Reported-by: default avatarNicolas Dichtel <nicolas.dichtel@6wind.com>
    Cc: Jay Vosburgh <j.vosburgh@gmail.com>
    Cc: Veaceslav Falico <vfalico@gmail.com>
    Cc: Andy Gospodarek <andy@greyhouse.net>
    Signed-off-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    f51048c3
dev.c 216 KB