[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190225081759.GP10051@dhcp-12-139.nay.redhat.com>
Date: Mon, 25 Feb 2019 16:17:59 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org, Stefano Brivio <sbrivio@...hat.com>,
"David S . Miller" <davem@...emloft.net>,
David Ahern <dsa@...ulusnetworks.com>
Subject: Re: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is
disabled
On Sun, Feb 24, 2019 at 08:24:51PM -0800, Eric Dumazet wrote:
>
>
> On 02/24/2019 08:12 PM, Hangbin Liu wrote:
> > ipv6_mod_enabled() is more safe and gentle to check if ipv6 is disabled
> > at running time.
> >
>
>
> Why is it better exactly ?
>
> IPv6 can be enabled on the host, but disabled per device
>
> /proc/sys/net/ipv6/conf/{name}/disable_ipv6
Sorry, it looks I didn't make it clear in the commit description.
This issue only occurs when IPv6 is disabled at boot time as there is
no IPv6 route entry. Disable ipv6 on specific interface is not affected.
So check ipv6_mod_enabled() is enough and we don't need to worry about
the rcu_read_lock or the dev status.
Should I update the commit description?
Thanks
Hangbin
>
>
> > Fixes: 173656accaf5 ("sit: check if IPv6 enabled before calling ip6_err_gen_icmpv6_unreach()")
> > Signed-off-by: Hangbin Liu <liuhangbin@...il.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;
> >
> >
Powered by blists - more mailing lists