diff options
author | Linus Lüssing <linus.luessing@c0d3.blue> | 2021-05-13 15:20:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-13 14:04:31 -0700 |
commit | 44ebb081dc6934e43d3c7444f183d6426adeca21 (patch) | |
tree | 5c5376c638b5f5f03a905e083cb37301d84e6cc4 /net/bridge/br_private.h | |
parent | ce6f709775bdf9bc8dd852a8758e10a98f31f280 (diff) | |
download | lwn-44ebb081dc6934e43d3c7444f183d6426adeca21.tar.gz lwn-44ebb081dc6934e43d3c7444f183d6426adeca21.zip |
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_private.h')
-rw-r--r-- | net/bridge/br_private.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 26e91d253687..d970ef78bf98 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -864,6 +864,16 @@ static inline bool br_group_is_l2(const struct br_ip *group) #define mlock_dereference(X, br) \ rcu_dereference_protected(X, lockdep_is_held(&br->multicast_lock)) +static inline struct hlist_node * +br_multicast_get_first_rport_node(struct net_bridge *b, struct sk_buff *skb) { + return rcu_dereference(hlist_first_rcu(&b->ip4_mc_router_list)); +} + +static inline struct net_bridge_port * +br_multicast_rport_from_node_skb(struct hlist_node *rp, struct sk_buff *skb) { + return hlist_entry_safe(rp, struct net_bridge_port, ip4_rlist); +} + static inline bool br_multicast_is_router(struct net_bridge *br) { return br->multicast_router == 2 || |