All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Andrei Vagin <avagin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, Xin Long <lucien.xin@gmail.com>
Subject: Re: [PATCH] sock_diag: fix autoloading of the raw_diag module
Date: Mon, 5 Nov 2018 10:12:34 +0300	[thread overview]
Message-ID: <20181105071234.GC2869@uranus.lan> (raw)
In-Reply-To: <20181105063715.21639-1-avagin@gmail.com>

On Sun, Nov 04, 2018 at 10:37:15PM -0800, Andrei Vagin wrote:
> IPPROTO_TCP isn't registred as an inet protocol, so
> inet_protos[protocol] is always NULL for it.

Typo, IPPROTO_RAW

> 
> Cc: Cyrill Gorcunov <gorcunov@gmail.com>
> Cc: Xin Long <lucien.xin@gmail.com>
> Fixes: bf2ae2e4bf93 ("sock_diag: request _diag module only when the family or proto has been registered")
> Signed-off-by: Andrei Vagin <avagin@gmail.com>
> ---
>  net/core/sock.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/net/core/sock.c b/net/core/sock.c
> index 6fcc4bc07d19..080a880a1761 100644
> --- a/net/core/sock.c
> +++ b/net/core/sock.c
> @@ -3279,6 +3279,7 @@ int sock_load_diag_module(int family, int protocol)
>  
>  #ifdef CONFIG_INET
>  	if (family == AF_INET &&
> +	    protocol != IPPROTO_RAW &&
>  	    !rcu_access_pointer(inet_protos[protocol]))
>  		return -ENOENT;
>  #endif

Andrew, looking into kernel code I wonder, maybe we should simply
add this protocol into inet_protos during net/ipv4/af_inet.c:inet_init?
It will require to add netns_ok into raw_prot of course.

  reply	other threads:[~2018-11-05 16:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05  6:37 [PATCH] sock_diag: fix autoloading of the raw_diag module Andrei Vagin
2018-11-05  7:12 ` Cyrill Gorcunov [this message]
2018-11-05 18:22   ` Cyrill Gorcunov
2018-11-06  1:10 ` David Miller

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=20181105071234.GC2869@uranus.lan \
    --to=gorcunov@gmail.com \
    --cc=avagin@gmail.com \
    --cc=davem@davemloft.net \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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.