--- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -2939,6 +2939,8 @@ enum netdev_cmd { NETDEV_OFFLOAD_XSTATS_REPORT_USED, NETDEV_OFFLOAD_XSTATS_REPORT_DELTA, NETDEV_XDP_FEAT_CHANGE, + NETDEV_BR_JOIN, + NETDEV_BR_LEAVE, }; const char *netdev_cmd_to_name(enum netdev_cmd cmd); --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -700,6 +700,7 @@ int br_add_if(struct net_bridge *br, str br_set_gso_limits(br); kobject_uevent(&p->kobj, KOBJ_ADD); + call_netdevice_notifiers(NETDEV_BR_JOIN, dev); return 0; @@ -736,6 +737,8 @@ int br_del_if(struct net_bridge *br, str if (!p || p->br != br) return -EINVAL; + call_netdevice_notifiers(NETDEV_BR_LEAVE, dev); + /* Since more than one interface can be attached to a bridge, * there still maybe an alternate path for netconsole to use; * therefore there is no reason for a NETDEV_RELEASE event. --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1730,6 +1730,8 @@ const char *netdev_cmd_to_name(enum netd N(PRE_CHANGEADDR) N(OFFLOAD_XSTATS_ENABLE) N(OFFLOAD_XSTATS_DISABLE) N(OFFLOAD_XSTATS_REPORT_USED) N(OFFLOAD_XSTATS_REPORT_DELTA) N(XDP_FEAT_CHANGE) + N(BR_JOIN) N(BR_LEAVE) + } #undef N return "UNKNOWN_NETDEV_EVENT";