[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00742c9b-9cf8-1025-2c3a-0684cd8f6c7f@cumulusnetworks.com>
Date: Mon, 25 Feb 2019 09:57:08 -0700
From: David Ahern <dsa@...ulusnetworks.com>
To: Hangbin Liu <liuhangbin@...il.com>, netdev@...r.kernel.org
Cc: Stefano Brivio <sbrivio@...hat.com>,
"David S . Miller" <davem@...emloft.net>
Subject: Re: [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is
disabled
On 2/24/19 9:13 PM, Hangbin Liu wrote:
> 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@...il.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,
>
seems to me the existing check is more appropriate and relevant for the
code path: is ipv6 enabled on this device versus is ipv6 enabled at all.
Powered by blists - more mailing lists