All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Netdev <netdev@vger.kernel.org>, Thomas Graf <tgraf@suug.ch>,
	"Eric W. Biederman" <ebiederm@aristanetworks.com>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: [PATCH] genetlink: make netns aware
Date: Wed, 17 Jun 2009 22:10:52 -0400	[thread overview]
Message-ID: <4A39A22C.6080005@hp.com> (raw)
In-Reply-To: <1245267218.31588.41.camel@johannes.local>

Johannes Berg wrote:
> This makes generic netlink network namespace aware.
> No actual generic netlink families are made namespace
> aware, they need to be checked one by one and then
> set the family->netnsok member to true.
> 
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
...
> --- wireless-testing.orig/include/net/net_namespace.h	2009-06-17 20:36:59.000000000 +0200
> +++ wireless-testing/include/net/net_namespace.h	2009-06-17 21:05:52.000000000 +0200
> @@ -26,6 +26,7 @@ struct net_device;
>  struct sock;
>  struct ctl_table_header;
>  struct net_generic;
> +struct sock;
>  
>  struct net {
>  	atomic_t		count;		/* To decided when the network
> @@ -63,6 +64,7 @@ struct net {
>  	struct netns_packet	packet;
>  	struct netns_unix	unx;
>  	struct netns_ipv4	ipv4;
> +	struct sock		*genl_sock;
>  #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
>  	struct netns_ipv6	ipv6;
>  #endif

Maybe you want to move *genl_sock up near the *rtnl sock?  Just seemed
strange to be stuck in the middle here to me.

> @@ -429,6 +450,10 @@ static int genl_rcv_msg(struct sk_buff *
>  	if (family == NULL)
>  		return -ENOENT;
>  
> +	/* this family doesn't exist in this netns */
> +	if (!family->netnsok && net != &init_net)
> +		return -ENOENT;

I know there's a net_eq() inline that exists, and actually becomes a no-op
when namespaces aren't built-in, so it might be worthwhile to change it
throughout, even if the rest of networking isn't consistent in using it.

-Brian

  parent reply	other threads:[~2009-06-18  2:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 19:33 [PATCH] genetlink: make netns aware Johannes Berg
2009-06-17 21:19 ` Eric W. Biederman
2009-06-17 21:37   ` Johannes Berg
2009-06-17 21:49     ` Eric W. Biederman
2009-06-17 21:54       ` Johannes Berg
2009-06-17 21:26 ` Johannes Berg
2009-06-18  2:10 ` Brian Haley [this message]
2009-06-18  2:16   ` Johannes Berg
  -- strict thread matches above, loose matches on Subject: below --
2009-06-18 11:16 Johannes Berg
2009-06-19  1:12 ` Johannes Berg

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=4A39A22C.6080005@hp.com \
    --to=brian.haley@hp.com \
    --cc=adobriyan@gmail.com \
    --cc=ebiederm@aristanetworks.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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.