Skip to content

Commit

Permalink
bridge: mcast: Simplify MDB entry creation
Browse files Browse the repository at this point in the history
Before creating a new MDB entry, br_multicast_new_group() will call
br_mdb_ip_get() to see if one exists and return it if so.

Therefore, simply call br_multicast_new_group() and omit the call to
br_mdb_ip_get().

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ido Schimmel authored and David S. Miller committed Oct 19, 2022
1 parent 262985f commit d1942cd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions net/bridge/br_mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,6 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
unsigned long now = jiffies;
unsigned char flags = 0;
u8 filter_mode;
int err;

__mdb_entry_to_br_ip(entry, &group, mdb_attrs);

Expand All @@ -892,13 +891,9 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
return -EINVAL;
}

mp = br_mdb_ip_get(br, &group);
if (!mp) {
mp = br_multicast_new_group(br, &group);
err = PTR_ERR_OR_ZERO(mp);
if (err)
return err;
}
mp = br_multicast_new_group(br, &group);
if (IS_ERR(mp))
return PTR_ERR(mp);

/* host join */
if (!port) {
Expand Down

0 comments on commit d1942cd

Please sign in to comment.