Skip to contentSkip to conversation

Correct mistake order of checking in if statement. Make sure t->dev->flags & IFF_UP is check first.

PATCH New Jamie Gloudon 1 participant 1 message Nov 6, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correct mistake order of checking in if statement. Make sure t->dev->flags & IFF_UP is check first.

---
 net/ipv6/ip6_tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/ip6_tunnel.c +1 -1
index 2fb4c6ad7243..22c71f991bb7 100644
@@ -162,7 +162,7 @@ ip6_tnl_lookup(struct net *net, int link,
 		return cand;
 
 	t = rcu_dereference(ip6n->collect_md_tun);
-	if (t && t->dev->flags & IFF_UP)
+	if (t && (t->dev->flags & IFF_UP))
 		return t;
 
 	t = rcu_dereference(ip6n->tnls_wc[0]);
Signature · 1 line
2.28.0