bridge: mcast: Centralize netlink attribute parsing
authorIdo Schimmel <idosch@nvidia.com>
Tue, 6 Dec 2022 10:58:01 +0000 (12:58 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 8 Dec 2022 04:05:51 +0000 (20:05 -0800)
commitcb453926865ea0dddda898c8184eebb595f3c53d
tree9ef5528edba56ec083ab85d1290fe0439fd4887c
parent16dc16d9f058dce7031ee8b850f10622b8b5fb14
bridge: mcast: Centralize netlink attribute parsing

Netlink attributes are currently passed deep in the MDB creation call
chain, making it difficult to add new attributes. In addition, some
validity checks are performed under the multicast lock although they can
be performed before it is ever acquired.

As a first step towards solving these issues, parse the RTM_{NEW,DEL}MDB
messages into a configuration structure, relieving other functions from
the need to handle raw netlink attributes.

Subsequent patches will convert the MDB code to use this configuration
structure.

This is consistent with how other rtnetlink objects are handled, such as
routes and nexthops.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_mdb.c
net/bridge/br_private.h