summaryrefslogtreecommitdiff
path: root/net/bridge/br_forward.c
diff options
context:
space:
mode:
authorLinus Lüssing <linus.luessing@c0d3.blue>2021-05-13 16:20:44 +0300
committerDavid S. Miller <davem@davemloft.net>2021-05-14 00:04:31 +0300
commit44ebb081dc6934e43d3c7444f183d6426adeca21 (patch)
tree5c5376c638b5f5f03a905e083cb37301d84e6cc4 /net/bridge/br_forward.c
parentce6f709775bdf9bc8dd852a8758e10a98f31f280 (diff)
downloadlinux-44ebb081dc6934e43d3c7444f183d6426adeca21.tar.xz
net: bridge: mcast: add wrappers for router node retrieval
In preparation for the upcoming split of multicast router state into their IPv4 and IPv6 variants and to avoid IPv6 #ifdef clutter later add two wrapper functions for router node retrieval in the payload forwarding code. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_forward.c')
-rw-r--r--net/bridge/br_forward.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index eb9847ad40cf..07856362538f 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -276,7 +276,8 @@ void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
bool allow_mode_include = true;
struct hlist_node *rp;
- rp = rcu_dereference(hlist_first_rcu(&br->ip4_mc_router_list));
+ rp = br_multicast_get_first_rport_node(br, skb);
+
if (mdst) {
p = rcu_dereference(mdst->ports);
if (br_multicast_should_handle_mode(br, mdst->addr.proto) &&
@@ -290,7 +291,7 @@ void br_multicast_flood(struct net_bridge_mdb_entry *mdst,
struct net_bridge_port *port, *lport, *rport;
lport = p ? p->key.port : NULL;
- rport = hlist_entry_safe(rp, struct net_bridge_port, ip4_rlist);
+ rport = br_multicast_rport_from_node_skb(rp, skb);
if ((unsigned long)lport > (unsigned long)rport) {
port = lport;