static void br_multicast_router_expired(struct timer_list *t)
{
struct net_bridge_port *port =
- from_timer(port, t, multicast_router_timer);
+ from_timer(port, t, ip4_mc_router_timer);
struct net_bridge *br = port->br;
spin_lock(&br->multicast_lock);
if (port->multicast_router == MDB_RTR_TYPE_DISABLED ||
port->multicast_router == MDB_RTR_TYPE_PERM ||
- timer_pending(&port->multicast_router_timer))
+ timer_pending(&port->ip4_mc_router_timer))
goto out;
__del_port_router(port);
static void br_multicast_local_router_expired(struct timer_list *t)
{
- struct net_bridge *br = from_timer(br, t, multicast_router_timer);
+ struct net_bridge *br = from_timer(br, t, ip4_mc_router_timer);
spin_lock(&br->multicast_lock);
if (br->multicast_router == MDB_RTR_TYPE_DISABLED ||
br->multicast_router == MDB_RTR_TYPE_PERM ||
- timer_pending(&br->multicast_router_timer))
+ timer_pending(&br->ip4_mc_router_timer))
goto out;
br_mc_router_state_change(br, false);
port->multicast_router = MDB_RTR_TYPE_TEMP_QUERY;
port->multicast_eht_hosts_limit = BR_MCAST_DEFAULT_EHT_HOSTS_LIMIT;
- timer_setup(&port->multicast_router_timer,
+ timer_setup(&port->ip4_mc_router_timer,
br_multicast_router_expired, 0);
timer_setup(&port->ip4_own_query.timer,
br_ip4_multicast_port_query_expired, 0);
hlist_move_list(&br->mcast_gc_list, &deleted_head);
spin_unlock_bh(&br->multicast_lock);
br_multicast_gc(&deleted_head);
- del_timer_sync(&port->multicast_router_timer);
+ del_timer_sync(&port->ip4_mc_router_timer);
free_percpu(port->mcast_stats);
}
br_multicast_enable(&port->ip6_own_query);
#endif
if (port->multicast_router == MDB_RTR_TYPE_PERM &&
- hlist_unhashed(&port->rlist))
+ hlist_unhashed(&port->ip4_rlist))
br_multicast_add_router(br, port);
}
__del_port_router(port);
- del_timer(&port->multicast_router_timer);
+ del_timer(&port->ip4_mc_router_timer);
del_timer(&port->ip4_own_query.timer);
#if IS_ENABLED(CONFIG_IPV6)
del_timer(&port->ip6_own_query.timer);
struct net_bridge_port *p;
struct hlist_node *slot = NULL;
- if (!hlist_unhashed(&port->rlist))
+ if (!hlist_unhashed(&port->ip4_rlist))
return;
- hlist_for_each_entry(p, &br->router_list, rlist) {
+ hlist_for_each_entry(p, &br->ip4_mc_router_list, ip4_rlist) {
if ((unsigned long) port >= (unsigned long) p)
break;
- slot = &p->rlist;
+ slot = &p->ip4_rlist;
}
if (slot)
- hlist_add_behind_rcu(&port->rlist, slot);
+ hlist_add_behind_rcu(&port->ip4_rlist, slot);
else
- hlist_add_head_rcu(&port->rlist, &br->router_list);
+ hlist_add_head_rcu(&port->ip4_rlist, &br->ip4_mc_router_list);
br_rtr_notify(br->dev, port, RTM_NEWMDB);
br_port_mc_router_state_change(port, true);
}
if (!port) {
if (br->multicast_router == MDB_RTR_TYPE_TEMP_QUERY) {
- if (!timer_pending(&br->multicast_router_timer))
+ if (!timer_pending(&br->ip4_mc_router_timer))
br_mc_router_state_change(br, true);
- mod_timer(&br->multicast_router_timer,
+ mod_timer(&br->ip4_mc_router_timer,
now + br->multicast_querier_interval);
}
return;
br_multicast_add_router(br, port);
- mod_timer(&port->multicast_router_timer,
+ mod_timer(&port->ip4_mc_router_timer,
now + br->multicast_querier_interval);
}
br_opt_toggle(br, BROPT_HAS_IPV6_ADDR, true);
spin_lock_init(&br->multicast_lock);
- timer_setup(&br->multicast_router_timer,
+ timer_setup(&br->ip4_mc_router_timer,
br_multicast_local_router_expired, 0);
timer_setup(&br->ip4_other_query.timer,
br_ip4_multicast_querier_expired, 0);
void br_multicast_stop(struct net_bridge *br)
{
- del_timer_sync(&br->multicast_router_timer);
+ del_timer_sync(&br->ip4_mc_router_timer);
del_timer_sync(&br->ip4_other_query.timer);
del_timer_sync(&br->ip4_own_query.timer);
#if IS_ENABLED(CONFIG_IPV6)
case MDB_RTR_TYPE_DISABLED:
case MDB_RTR_TYPE_PERM:
br_mc_router_state_change(br, val == MDB_RTR_TYPE_PERM);
- del_timer(&br->multicast_router_timer);
+ del_timer(&br->ip4_mc_router_timer);
br->multicast_router = val;
err = 0;
break;
static void __del_port_router(struct net_bridge_port *p)
{
- if (hlist_unhashed(&p->rlist))
+ if (hlist_unhashed(&p->ip4_rlist))
return;
- hlist_del_init_rcu(&p->rlist);
+ hlist_del_init_rcu(&p->ip4_rlist);
br_rtr_notify(p->br->dev, p, RTM_DELMDB);
br_port_mc_router_state_change(p, false);
if (p->multicast_router == val) {
/* Refresh the temp router port timer */
if (p->multicast_router == MDB_RTR_TYPE_TEMP)
- mod_timer(&p->multicast_router_timer,
+ mod_timer(&p->ip4_mc_router_timer,
now + br->multicast_querier_interval);
err = 0;
goto unlock;
case MDB_RTR_TYPE_DISABLED:
p->multicast_router = MDB_RTR_TYPE_DISABLED;
__del_port_router(p);
- del_timer(&p->multicast_router_timer);
+ del_timer(&p->ip4_mc_router_timer);
break;
case MDB_RTR_TYPE_TEMP_QUERY:
p->multicast_router = MDB_RTR_TYPE_TEMP_QUERY;
break;
case MDB_RTR_TYPE_PERM:
p->multicast_router = MDB_RTR_TYPE_PERM;
- del_timer(&p->multicast_router_timer);
+ del_timer(&p->ip4_mc_router_timer);
br_multicast_add_router(br, p);
break;
case MDB_RTR_TYPE_TEMP:
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
struct bridge_mcast_own_query ip4_own_query;
+ struct timer_list ip4_mc_router_timer;
+ struct hlist_node ip4_rlist;
#if IS_ENABLED(CONFIG_IPV6)
struct bridge_mcast_own_query ip6_own_query;
#endif /* IS_ENABLED(CONFIG_IPV6) */
u32 multicast_eht_hosts_cnt;
unsigned char multicast_router;
struct bridge_mcast_stats __percpu *mcast_stats;
- struct timer_list multicast_router_timer;
struct hlist_head mglist;
- struct hlist_node rlist;
#endif
#ifdef CONFIG_SYSFS
struct hlist_head mcast_gc_list;
struct hlist_head mdb_list;
- struct hlist_head router_list;
- struct timer_list multicast_router_timer;
+ struct hlist_head ip4_mc_router_list;
+ struct timer_list ip4_mc_router_timer;
struct bridge_mcast_other_query ip4_other_query;
struct bridge_mcast_own_query ip4_own_query;
struct bridge_mcast_querier ip4_querier;
{
return br->multicast_router == 2 ||
(br->multicast_router == 1 &&
- timer_pending(&br->multicast_router_timer));
+ timer_pending(&br->ip4_mc_router_timer));
}
static inline bool