Skip to contentSkip to conversation

mlxsw: spectrum_router: Only handle IPv4 and IPv6 events

PATCH Applied Jiri Pirko 2 participants 2 messages Sep 15, 2017 – Sep 16, 2017

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH 1/1 mlxsw: spectrum_router: Only handle IPv4 and IPv6 events

From: Ido Schimmel <[email protected]>

The driver doesn't support events from address families other than IPv4 and IPv6, so ignore them. Otherwise, we risk queueing a work item before it's initialized.

This can happen in case a VRF is configured when MROUTE_MULTIPLE_TABLES is enabled, as the VRF driver will try to add an l3mdev rule for the IPMR family.

Fixes 65e65ec137f4 ("mlxsw: spectrum_router: Don't ignore IPv6 notifications")
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +2 -1
index f0fb898..2cfb3f5 100644
@@ -4868,7 +4868,8 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb,
 	struct fib_notifier_info *info = ptr;
 	struct mlxsw_sp_router *router;
 
-	if (!net_eq(info->net, &init_net))
+	if (!net_eq(info->net, &init_net) ||
+	    (info->family != AF_INET && info->family != AF_INET6))
 		return NOTIFY_DONE;
 
 	fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);
Signature · 1 line
2.9.3
maintainer Applied
#1 lore raw

From: Jiri Pirko <[email protected]>
Date: Fri, 15 Sep 2017 15:31:07 +0200

Quoted 10 lines

From: Ido Schimmel <[email protected]>

The driver doesn't support events from address families other than IPv4 and IPv6, so ignore them. Otherwise, we risk queueing a work item before it's initialized.

This can happen in case a VRF is configured when MROUTE_MULTIPLE_TABLES is enabled, as the VRF driver will try to add an l3mdev rule for the IPMR family.

Quoted 5 lines
Fixes 65e65ec137f4 ("mlxsw: spectrum_router: Don't ignore IPv6 notifications")

Applied, thanks.