• Mark Bloch's avatar
    net/bonding: Enforce active-backup policy for IPoIB bonds · b279dfac
    Mark Bloch authored
    BugLink: https://bugs.launchpad.net/bugs/1668042
    
    When using an IPoIB bond currently only active-backup mode is a valid
    use case and this commit strengthens it.
    
    Since commit 2ab82852 ("net/bonding: Enable bonding to enslave
    netdevices not supporting set_mac_address()") was introduced till
    4.7-rc1, IPoIB didn't support the set_mac_address ndo, and hence the
    fail over mac policy always applied to IPoIB bonds.
    
    With the introduction of commit 492a7e67
    
     ("IB/IPoIB: Allow setting
    the device address"), that doesn't hold and practically IPoIB bonds are
    broken as of that. To fix it, lets go to fail over mac if the device
    doesn't support the ndo OR this is IPoIB device.
    
    As a by-product, this commit also prevents a stack corruption which
    occurred when trying to copy 20 bytes (IPoIB) device address
    to a sockaddr struct that has only 16 bytes of storage.
    Signed-off-by: default avatarMark Bloch <markb@mellanox.com>
    Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
    ...
    b279dfac
bond_main.c 132 KB