[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1245291388.31588.80.camel@johannes.local>
Date: Thu, 18 Jun 2009 04:16:28 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Brian Haley <brian.haley@...com>
Cc: Netdev <netdev@...r.kernel.org>, Thomas Graf <tgraf@...g.ch>,
"Eric W. Biederman" <ebiederm@...stanetworks.com>,
Alexey Dobriyan <adobriyan@...il.com>
Subject: Re: [PATCH] genetlink: make netns aware
On Wed, 2009-06-17 at 22:10 -0400, Brian Haley wrote:
> 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@...solutions.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.
Heh I dunno, doesn't matter to me. I just didn't want to stick it at the
end because I'd stuck wext there.
> > @@ -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.
Good catch.
johannes
Download attachment "signature.asc" of type "application/pgp-signature" (802 bytes)
Powered by blists - more mailing lists