All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled
@ 2019-02-25  4:12 Hangbin Liu
  2019-02-25  4:24 ` Eric Dumazet
  0 siblings, 1 reply; 10+ messages in thread
From: Hangbin Liu @ 2019-02-25  4:12 UTC (permalink / raw)
  To: netdev; +Cc: Stefano Brivio, David S . Miller, David Ahern, Hangbin Liu

ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled
at running time.

Fixes: 173656accaf5 ("sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 net/ipv6/sit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index e8a1dabef803..eea1f19985a7 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -546,7 +546,7 @@ static int ipip6_err(struct sk_buff *skb, u32 info)
 	}
 
 	err = 0;
-	if (__in6_dev_get(skb->dev) &&
+	if (ipv6_mod_enabled() &&
 	    !ip6_err_gen_icmpv6_unreach(skb, iph->ihl * 4, type, data_len))
 		goto out;
 
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-26  4:36 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25  4:12 [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled Hangbin Liu
2019-02-25  4:24 ` Eric Dumazet
2019-02-25  8:17   ` Hangbin Liu
2019-02-25 16:39     ` Eric Dumazet
2019-02-25 16:57       ` David Ahern
2019-02-26  1:55         ` Hangbin Liu
2019-02-26  2:15           ` David Ahern
2019-02-26  4:08             ` Hangbin Liu
2019-02-26  4:36               ` Eric Dumazet
2019-02-26  1:43       ` Hangbin Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.