From: David Ahern <d...@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 <liuhang...@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.

Reply via email to