• Vincent Bernat's avatar
    bridge: trigger RTM_NEWLINK when interface is modified by bridge ioctl · 8701352b
    Vincent Bernat authored
    Currently, there is a difference in netlink events received when an
    interface is modified through bridge ioctl() or through netlink. This
    patch generates additional events when an interface is added to or
    removed from a bridge via ioctl().
    
    When adding then removing an interface from a bridge with netlink, we
    get:
    
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    Deleted 5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    
    When using ioctl():
    
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge0 state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    Deleted 5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 master bridge0 state UNKNOWN
        link/ether 9e:da:60:ee:cf:c8
    5: dummy1: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
        link/ether 9e:da:60:ee:cf:c8 brd ff:ff:ff:ff:ff:ff
    
    Without this patch, the last netlink notification is not sent.
    Signed-off-by: default avatarVincent Bernat <vincent@bernat.im>
    Reviewed-by: default avatarStephen Hemminger <stephen@networkplumber.org>
    Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8701352b
br_ioctl.c 9.06 KB