@@ -959,17 +959,15 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
return 0;
}
-static int __br_mdb_add(struct net *net, struct net_bridge *br,
- struct net_bridge_port *p,
- struct br_mdb_entry *entry,
+static int __br_mdb_add(const struct br_mdb_config *cfg,
struct nlattr **mdb_attrs,
struct netlink_ext_ack *extack)
{
int ret;
- spin_lock_bh(&br->multicast_lock);
- ret = br_mdb_add_group(br, p, entry, mdb_attrs, extack);
- spin_unlock_bh(&br->multicast_lock);
+ spin_lock_bh(&cfg->br->multicast_lock);
+ ret = br_mdb_add_group(cfg->br, cfg->p, cfg->entry, mdb_attrs, extack);
+ spin_unlock_bh(&cfg->br->multicast_lock);
return ret;
}
@@ -1120,22 +1118,22 @@ static int br_mdb_add(struct sk_buff *skb, struct nlmsghdr *nlh,
if (br_vlan_enabled(cfg.br->dev) && vg && cfg.entry->vid == 0) {
list_for_each_entry(v, &vg->vlan_list, vlist) {
cfg.entry->vid = v->vid;
- err = __br_mdb_add(net, cfg.br, cfg.p, cfg.entry,
- mdb_attrs, extack);
+ err = __br_mdb_add(&cfg, mdb_attrs, extack);
if (err)
break;
}
} else {
- err = __br_mdb_add(net, cfg.br, cfg.p, cfg.entry, mdb_attrs,
- extack);
+ err = __br_mdb_add(&cfg, mdb_attrs, extack);
}
return err;
}
-static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry,
+static int __br_mdb_del(const struct br_mdb_config *cfg,
struct nlattr **mdb_attrs)
{
+ struct br_mdb_entry *entry = cfg->entry;
+ struct net_bridge *br = cfg->br;
struct net_bridge_mdb_entry *mp;
struct net_bridge_port_group *p;
struct net_bridge_port_group __rcu **pp;
@@ -1206,10 +1204,10 @@ static int br_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
if (br_vlan_enabled(cfg.br->dev) && vg && cfg.entry->vid == 0) {
list_for_each_entry(v, &vg->vlan_list, vlist) {
cfg.entry->vid = v->vid;
- err = __br_mdb_del(cfg.br, cfg.entry, mdb_attrs);
+ err = __br_mdb_del(&cfg, mdb_attrs);
}
} else {
- err = __br_mdb_del(cfg.br, cfg.entry, mdb_attrs);
+ err = __br_mdb_del(&cfg, mdb_attrs);
}
return err;