diff options
| -rw-r--r-- | include/linux/if_bridge.h | 6 | ||||
| -rw-r--r-- | net/bridge/br_fdb.c | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index ef7c3d376b21..627b788ba0ff 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
| @@ -119,6 +119,7 @@ static inline int br_vlan_get_info(const struct net_device *dev, u16 vid, | |||
| 119 | struct net_device *br_fdb_find_port(const struct net_device *br_dev, | 119 | struct net_device *br_fdb_find_port(const struct net_device *br_dev, |
| 120 | const unsigned char *addr, | 120 | const unsigned char *addr, |
| 121 | __u16 vid); | 121 | __u16 vid); |
| 122 | void br_fdb_clear_offload(const struct net_device *dev, u16 vid); | ||
| 122 | bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag); | 123 | bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag); |
| 123 | #else | 124 | #else |
| 124 | static inline struct net_device * | 125 | static inline struct net_device * |
| @@ -128,6 +129,11 @@ br_fdb_find_port(const struct net_device *br_dev, | |||
| 128 | { | 129 | { |
| 129 | return NULL; | 130 | return NULL; |
| 130 | } | 131 | } |
| 132 | |||
| 133 | static inline void br_fdb_clear_offload(const struct net_device *dev, u16 vid) | ||
| 134 | { | ||
| 135 | } | ||
| 136 | |||
| 131 | static inline bool | 137 | static inline bool |
| 132 | br_port_flag_is_set(const struct net_device *dev, unsigned long flag) | 138 | br_port_flag_is_set(const struct net_device *dev, unsigned long flag) |
| 133 | { | 139 | { |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index e56ba3912a90..38b1d0dd0529 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
| @@ -1164,3 +1164,23 @@ void br_fdb_offloaded_set(struct net_bridge *br, struct net_bridge_port *p, | |||
| 1164 | 1164 | ||
| 1165 | spin_unlock_bh(&br->hash_lock); | 1165 | spin_unlock_bh(&br->hash_lock); |
| 1166 | } | 1166 | } |
| 1167 | |||
| 1168 | void br_fdb_clear_offload(const struct net_device *dev, u16 vid) | ||
| 1169 | { | ||
| 1170 | struct net_bridge_fdb_entry *f; | ||
| 1171 | struct net_bridge_port *p; | ||
| 1172 | |||
| 1173 | ASSERT_RTNL(); | ||
| 1174 | |||
| 1175 | p = br_port_get_rtnl(dev); | ||
| 1176 | if (!p) | ||
| 1177 | return; | ||
| 1178 | |||
| 1179 | spin_lock_bh(&p->br->hash_lock); | ||
| 1180 | hlist_for_each_entry(f, &p->br->fdb_list, fdb_node) { | ||
| 1181 | if (f->dst == p && f->key.vlan_id == vid) | ||
| 1182 | f->offloaded = 0; | ||
| 1183 | } | ||
| 1184 | spin_unlock_bh(&p->br->hash_lock); | ||
| 1185 | } | ||
| 1186 | EXPORT_SYMBOL_GPL(br_fdb_clear_offload); | ||
