Skip to content

Commit

Permalink
net: bridge: multicast: factor out port multicast context
Browse files Browse the repository at this point in the history
Factor out the port's multicast context into a separate structure which
will later be shared for per-port,vlan context. No functional changes
intended. We need the structure even if bridge multicast is not defined
to pass down as pointer to forwarding functions.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Nikolay Aleksandrov authored and davem330 committed Jul 20, 2021
1 parent 23d2b94 commit 9632233
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 99 deletions.
10 changes: 5 additions & 5 deletions net/bridge/br_mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ static bool br_rports_have_mc_router(struct net_bridge *br)
static bool
br_ip4_rports_get_timer(struct net_bridge_port *port, unsigned long *timer)
{
*timer = br_timer_value(&port->ip4_mc_router_timer);
return !hlist_unhashed(&port->ip4_rlist);
*timer = br_timer_value(&port->multicast_ctx.ip4_mc_router_timer);
return !hlist_unhashed(&port->multicast_ctx.ip4_rlist);
}

static bool
br_ip6_rports_get_timer(struct net_bridge_port *port, unsigned long *timer)
{
#if IS_ENABLED(CONFIG_IPV6)
*timer = br_timer_value(&port->ip6_mc_router_timer);
return !hlist_unhashed(&port->ip6_rlist);
*timer = br_timer_value(&port->multicast_ctx.ip6_mc_router_timer);
return !hlist_unhashed(&port->multicast_ctx.ip6_rlist);
#else
*timer = 0;
return false;
Expand Down Expand Up @@ -79,7 +79,7 @@ static int br_rports_fill_info(struct sk_buff *skb, struct netlink_callback *cb,
nla_put_u32(skb, MDBA_ROUTER_PATTR_TIMER,
max(ip4_timer, ip6_timer)) ||
nla_put_u8(skb, MDBA_ROUTER_PATTR_TYPE,
p->multicast_router) ||
p->multicast_ctx.multicast_router) ||
(have_ip4_mc_rtr &&
nla_put_u32(skb, MDBA_ROUTER_PATTR_INET_TIMER,
ip4_timer)) ||
Expand Down
Loading

0 comments on commit 9632233

Please sign in to comment.