netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled
@ 2019-02-25  4:13 Hangbin Liu
  2019-02-25 16:57 ` David Ahern
  0 siblings, 1 reply; 3+ messages in thread
From: Hangbin Liu @ 2019-02-25  4:13 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: 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


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

* Re: [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled
  2019-02-25  4:13 [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled Hangbin Liu
@ 2019-02-25 16:57 ` David Ahern
  2019-02-25 18:28   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: David Ahern @ 2019-02-25 16:57 UTC (permalink / raw)
  To: Hangbin Liu, netdev; +Cc: Stefano Brivio, David S . Miller

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@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,
> 

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.

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

* Re: [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled
  2019-02-25 16:57 ` David Ahern
@ 2019-02-25 18:28   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2019-02-25 18:28 UTC (permalink / raw)
  To: dsa; +Cc: liuhangbin, netdev, sbrivio

From: David Ahern <dsa@cumulusnetworks.com>
Date: Mon, 25 Feb 2019 09:57:08 -0700

> 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@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,
>> 
> 
> 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.

Agreed.

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

end of thread, other threads:[~2019-02-25 18:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-25  4:13 [PATCH net] geneve: use ipv6_mod_enabled to check if ipv6 is disabled Hangbin Liu
2019-02-25 16:57 ` David Ahern
2019-02-25 18:28   ` David Miller

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).