]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: mcast: record querier port device ifindex instead of pointer
authorNikolay Aleksandrov <nikolay@nvidia.com>
Fri, 13 Aug 2021 14:59:57 +0000 (17:59 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Aug 2021 13:02:43 +0000 (14:02 +0100)
commitcc65c5201165f4e5b6844279eedaa5985d36a651
tree8c37a3ae08cb262aff32315e609bb787dc1ad23a
parent6c9f2fddc81ca525dab4c576e7461428d3155ffa
net: bridge: mcast: record querier port device ifindex instead of pointer

Currently when a querier port is detected its net_bridge_port pointer is
recorded, but it's used only for comparisons so it's fine to have stale
pointer, in order to dereference and use the port pointer a proper
accounting of its usage must be implemented adding unnecessary
complexity. To solve the problem we can just store the netdevice ifindex
instead of the port pointer and retrieve the bridge port. It is a best
effort and the device needs to be validated that is still part of that
bridge before use, but that is small price to pay for avoiding querier
reference counting for each port/vlan.

Signed-off-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_multicast.c
net/bridge/br_private.h