Skip to content

Commit

Permalink
bridge: mdb: fill state in br_mdb_notify
Browse files Browse the repository at this point in the history
Fill also the port group state when sending notifications.

Signed-off-by: Satish Ashok <sashok@cumulusnetworks.com>
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Nikolay Aleksandrov authored and David S. Miller committed Jul 10, 2015
1 parent cb1c616 commit 09cf021
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions net/bridge/br_mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void __br_mdb_notify(struct net_device *dev, struct br_mdb_entry *entry,
}

void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
struct br_ip *group, int type)
struct br_ip *group, int type, u8 state)
{
struct br_mdb_entry entry;

Expand All @@ -241,6 +241,7 @@ void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
#if IS_ENABLED(CONFIG_IPV6)
entry.addr.u.ip6 = group->u.ip6;
#endif
entry.state = state;
__br_mdb_notify(dev, &entry, type);
}

Expand Down Expand Up @@ -348,7 +349,7 @@ static int br_mdb_add_group(struct net_bridge *br, struct net_bridge_port *port,
return -ENOMEM;
rcu_assign_pointer(*pp, p);

br_mdb_notify(br->dev, port, group, RTM_NEWMDB);
br_mdb_notify(br->dev, port, group, RTM_NEWMDB, state);
return 0;
}

Expand Down
5 changes: 3 additions & 2 deletions net/bridge/br_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ static int br_multicast_add_group(struct net_bridge *br,
if (unlikely(!p))
goto err;
rcu_assign_pointer(*pp, p);
br_mdb_notify(br->dev, port, group, RTM_NEWMDB);
br_mdb_notify(br->dev, port, group, RTM_NEWMDB, MDB_TEMPORARY);

found:
mod_timer(&p->timer, now + br->multicast_membership_interval);
Expand Down Expand Up @@ -1439,8 +1439,9 @@ br_multicast_leave_group(struct net_bridge *br,
rcu_assign_pointer(*pp, p->next);
hlist_del_init(&p->mglist);
del_timer(&p->timer);
br_mdb_notify(br->dev, port, group, RTM_DELMDB,
p->state);
call_rcu_bh(&p->rcu, br_multicast_free_pg);
br_mdb_notify(br->dev, port, group, RTM_DELMDB);

if (!mp->ports && !mp->mglist &&
netif_running(br->dev))
Expand Down
2 changes: 1 addition & 1 deletion net/bridge/br_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ br_multicast_new_port_group(struct net_bridge_port *port, struct br_ip *group,
void br_mdb_init(void);
void br_mdb_uninit(void);
void br_mdb_notify(struct net_device *dev, struct net_bridge_port *port,
struct br_ip *group, int type);
struct br_ip *group, int type, u8 state);

#define mlock_dereference(X, br) \
rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock))
Expand Down

0 comments on commit 09cf021

Please sign in to comment.