All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <liuhangbin@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: netdev@vger.kernel.org, Stefano Brivio <sbrivio@redhat.com>,
	"David S . Miller" <davem@davemloft.net>,
	David Ahern <dsa@cumulusnetworks.com>
Subject: Re: [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled
Date: Tue, 26 Feb 2019 09:43:21 +0800	[thread overview]
Message-ID: <20190226014321.GQ10051@dhcp-12-139.nay.redhat.com> (raw)
In-Reply-To: <1dd57d9d-fed2-67b8-ac28-7ef3681eeed2@gmail.com>

On Mon, Feb 25, 2019 at 08:39:27AM -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?
> 
> Certainly. Are you telling us skb->dev could be NULL here ?
> 
> Because rcu_read_lock() should already be asserted.
> 

No. I know skb->dev is not NULL and we have rcu_read_lock() here. But can we
guarantee the skb->dev won't be NULL forever? Maybe I'm a little sensitive.

I mean for only checking if ipv6 is disable at boot time, use
ipv6_mod_enabled() is more suitable.

Thanks
Hangbin

      parent reply	other threads:[~2019-02-26  1:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-25  4:12 [PATCH net] sit: use ipv6_mod_enabled to check if ipv6 is disabled Hangbin Liu
2019-02-25  4:24 ` Eric Dumazet
2019-02-25  8:17   ` Hangbin Liu
2019-02-25 16:39     ` Eric Dumazet
2019-02-25 16:57       ` David Ahern
2019-02-26  1:55         ` Hangbin Liu
2019-02-26  2:15           ` David Ahern
2019-02-26  4:08             ` Hangbin Liu
2019-02-26  4:36               ` Eric Dumazet
2019-02-26  1:43       ` Hangbin Liu [this message]

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=20190226014321.GQ10051@dhcp-12-139.nay.redhat.com \
    --to=liuhangbin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eric.dumazet@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.