netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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] geneve: use ipv6_mod_enabled to check if ipv6 is disabled
Date: Mon, 25 Feb 2019 12:13:50 +0800	[thread overview]
Message-ID: <20190225041350.9913-1-liuhangbin@gmail.com> (raw)

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

Fixes: c0a47e44c098 ("geneve: should not call rt6_lookup() when ipv6 was disabled")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
---
 drivers/net/geneve.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index 3377ac66a347..42c5e43ece68 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1514,7 +1514,7 @@ static void geneve_link_config(struct net_device *dev,
 	case AF_INET6: {
 		struct rt6_info *rt;
 
-		if (!__in6_dev_get(dev))
+		if (!ipv6_mod_enabled())
 			break;
 
 		rt = rt6_lookup(geneve->net, &info->key.u.ipv6.dst, NULL, 0,
-- 
2.19.2


             reply	other threads:[~2019-02-25  4:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25  4:13 Hangbin Liu [this message]
2019-02-25 16:57 ` [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled David Ahern
2019-02-25 18:28   ` David Miller

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=20190225041350.9913-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;
as well as URLs for NNTP newsgroup(s).