diff options
author | Ido Schimmel <idosch@nvidia.com> | 2022-12-10 16:56:20 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-12-12 15:33:36 -0800 |
commit | b63e30651c59bdef89ec158879d146e8d89cd5e1 (patch) | |
tree | 1d2a3f5d334ddd5a5eb6163ebea88dfe3273aadd /net/bridge | |
parent | 02abf84aa52da86586ec6323969afa158ec6e4aa (diff) | |
download | linux-rpi-b63e30651c59bdef89ec158879d146e8d89cd5e1.tar.gz linux-rpi-b63e30651c59bdef89ec158879d146e8d89cd5e1.tar.bz2 linux-rpi-b63e30651c59bdef89ec158879d146e8d89cd5e1.zip |
bridge: mcast: Do not derive entry type from its filter mode
Currently, the filter mode (i.e., INCLUDE / EXCLUDE) of MDB entries
cannot be set from user space. Instead, it is set by the kernel
according to the entry type: (*, G) entries are treated as EXCLUDE and
(S, G) entries are treated as INCLUDE. This allows the kernel to derive
the entry type from its filter mode.
Subsequent patches will allow user space to set the filter mode of (*,
G) entries, making the current assumption incorrect.
As a preparation, remove the current assumption and instead determine
the entry type from its key, which is a more direct way.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/bridge')
-rw-r--r-- | net/bridge/br_mdb.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index ae7d93c08880..2b6921dbdc02 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c @@ -857,17 +857,14 @@ static int br_mdb_add_group(const struct br_mdb_config *cfg, * added to it for proper replication */ if (br_multicast_should_handle_mode(brmctx, group.proto)) { - switch (filter_mode) { - case MCAST_EXCLUDE: - br_multicast_star_g_handle_mode(p, MCAST_EXCLUDE); - break; - case MCAST_INCLUDE: + if (br_multicast_is_star_g(&group)) { + br_multicast_star_g_handle_mode(p, filter_mode); + } else { star_group = p->key.addr; memset(&star_group.src, 0, sizeof(star_group.src)); star_mp = br_mdb_ip_get(br, &star_group); if (star_mp) br_multicast_sg_add_exclude_ports(star_mp, p); - break; } } |