From: Hangbin Liu <liuhangbin@gmail.com>
To: netdev@vger.kernel.org
Cc: Stefano Brivio <sbrivio@redhat.com>,
"David S . Miller" <davem@davemloft.net>,
David Ahern <dsa@cumulusnetworks.com>,
Hangbin Liu <liuhangbin@gmail.com>
Subject: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled
Date: Mon, 25 Feb 2019 12:12:43 +0800 [thread overview]
Message-ID: <20190225041243.9753-1-liuhangbin@gmail.com> (raw)
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
next reply other threads:[~2019-02-25 4:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 4:12 Hangbin Liu [this message]
2019-02-25 4:24 ` [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190225041243.9753-1-liuhangbin@gmail.com \
--to=liuhangbin@gmail.com \
--cc=davem@davemloft.net \
--cc=dsa@cumulusnetworks.com \
--cc=netdev@vger.kernel.org \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox