Skip to contentSkip to conversation

mlx5: Add missing init_net check in FIB notifier

PATCH Applied Jiri Pirko 3 participants 3 messages Aug 30, 2019 – Sep 2, 2019

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author
#0 lore raw

PATCH v2 1/1 mlx5: Add missing init_net check in FIB notifier

From: Jiri Pirko <[email protected]>

Take only FIB events that are happening in init_net into account. No other namespaces are supported.

---
v1->v2:
- no change, just cced maintainers (fat finger made me avoid them in v1)

---
 drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c +3 -0
index e69766393990..5d20d615663e 100644
@@ -248,6 +248,9 @@ static int mlx5_lag_fib_event(struct notifier_block *nb,
 	struct net_device *fib_dev;
 	struct fib_info *fi;
 
+	if (!net_eq(info->net, &init_net))
+		return NOTIFY_DONE;
+
 	if (info->family != AF_INET)
 		return NOTIFY_DONE;
 
Signature · 1 line
2.21.0
Acked-by on v2 1/1
#1 lore raw
Quoted 19 lines · Jiri Pirko

From: Jiri Pirko <[email protected]>

Take only FIB events that are happening in init_net into account. No other namespaces are supported.

---
v1->v2:
- no change, just cced maintainers (fat finger made me avoid them in v1)

---
 drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c +0 -0
index e69766393990..5d20d615663e 100644

drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c static int mlx5_lag_fib_event(struct notifier_block *nb, · line 256

Quoted 9 lines
drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c +3 -0
@@ -248,6 +248,9 @@ static int mlx5_lag_fib_event(struct notifier_block *nb,
 	struct net_device *fib_dev;
 	struct fib_info *fi;
 
+	if (!net_eq(info->net, &init_net))
+		return NOTIFY_DONE;
+
 	if (info->family != AF_INET)
 		return NOTIFY_DONE;
 

thanks