This function contains the logic for correctly setting the bridge binding behavior of a vlan interface. Therefore, it should be executed whenever the bridge binding flag of a vlan interface changes via the vlan_dev_change_flags function in the 8021q module. Currently this function is private, and it is only executed when a vlan interface is first created. Export the function so that it can be called from vlan_dev_change_flags. Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@xxxxxxxxx> Reviewed-by: Stefano Brivio <sbrivio@xxxxxxxxxx> Reviewed-by: Andy Roulin <aroulin@xxxxxxxxxx> Reviewed-by: Roopa Prabhu <roopa@xxxxxxxxxx> --- include/linux/if_bridge.h | 9 +++++++++ net/bridge/br_vlan.c | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index d62ef428e3aa..0d92b0ed0961 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h @@ -180,6 +180,9 @@ void br_fdb_clear_offload(const struct net_device *dev, u16 vid); bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag); u8 br_port_get_stp_state(const struct net_device *dev); clock_t br_get_ageing_time(const struct net_device *br_dev); +void br_vlan_upper_change(struct net_device *dev, + struct net_device *upper_dev, + bool linking); #else static inline struct net_device * br_fdb_find_port(const struct net_device *br_dev, @@ -208,6 +211,12 @@ static inline clock_t br_get_ageing_time(const struct net_device *br_dev) { return 0; } + +static inline void br_vlan_upper_change(struct net_device *dev, + struct net_device *upper_dev, + bool linking) +{ +} #endif #endif diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index 6e53dc991409..6bfc36da5a88 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c @@ -1653,9 +1653,9 @@ static void br_vlan_set_all_vlan_dev_state(struct net_bridge_port *p) } } -static void br_vlan_upper_change(struct net_device *dev, - struct net_device *upper_dev, - bool linking) +void br_vlan_upper_change(struct net_device *dev, + struct net_device *upper_dev, + bool linking) { struct net_bridge *br = netdev_priv(dev); @@ -1670,6 +1670,7 @@ static void br_vlan_upper_change(struct net_device *dev, br_vlan_has_upper_bind_vlan_dev(dev)); } } +EXPORT_SYMBOL_GPL(br_vlan_upper_change); struct br_vlan_link_state_walk_data { struct net_bridge *br; -- 2.25.1