Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-11 Thread Eric W. Biederman
Johannes Berg <[EMAIL PROTECTED]> writes: > On Wed, 2007-10-10 at 13:51 -0600, Eric W. Biederman wrote: > >> Yes. Netlink sockets are per-namespace and you can use the namespace >> of a netlink socket to look up a netdev. > > Ok, thanks. I still haven't really looked into the wireless vs. net > n

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-11 Thread Johannes Berg
On Wed, 2007-10-10 at 13:51 -0600, Eric W. Biederman wrote: > Yes. Netlink sockets are per-namespace and you can use the namespace > of a netlink socket to look up a netdev. Ok, thanks. I still haven't really looked into the wireless vs. net namespaces problem but this will probably help. johan

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-10 Thread Eric W. Biederman
Johannes Berg <[EMAIL PROTECTED]> writes: > On Tue, 2007-10-09 at 11:41 -0600, Eric W. Biederman wrote: > >> So please hold off on this until the kernel has been audited and >> we have removed all of the uses of ifindex that assume ifindex is >> global, that we can find. > > I certainly have this

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-10 Thread Johannes Berg
On Tue, 2007-10-09 at 11:41 -0600, Eric W. Biederman wrote: > So please hold off on this until the kernel has been audited and > we have removed all of the uses of ifindex that assume ifindex is > global, that we can find. I certainly have this assumption in the wireless code (cfg80211). How woul

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-10 Thread Eric W. Biederman
Pavel Emelyanov <[EMAIL PROTECTED]> writes: >> I know there are several data structures internal to the kernel that >> are indexed by ifindex, and not struct net_device *. There is the >> iflink field in struct net_device. We need a way to refer to network >> devices in other namespaces in rtnet

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-10 Thread Pavel Emelyanov
Eric W. Biederman wrote: > Pavel Emelyanov <[EMAIL PROTECTED]> writes: > >> Currently indexes for netdevices come sequentially one by >> one, and the same stays true even for devices that are >> created for namespaces. >> >> Side effects of this are: >> * lo device has not 1 index in a namespace

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman) Date: Tue, 09 Oct 2007 15:00:10 -0600 > Regardless it is early yet and there is plenty of time to revisit this > after we solved the easier and less controversial problems. Ok. I would encourage you to learn how the SNMP mibs work, and whether they ass

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread Eric W. Biederman
David Miller <[EMAIL PROTECTED]> writes: > From: [EMAIL PROTECTED] (Eric W. Biederman) > Date: Tue, 09 Oct 2007 11:43:58 -0600 > >> David Stevens <[EMAIL PROTECTED]> writes: >> >> > Sorry if this is a dumb question, but what is the model you intend for >> > SNMP? Do you want each namespace to be

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread David Miller
From: David Stevens <[EMAIL PROTECTED]> Date: Tue, 9 Oct 2007 09:18:25 -0700 > Ifindex's have to uniquely identify the interface (virtual or > otherwise) to remote queriers (not just local applications), so > unless you pay the price of separating all the SNMP MIBs per > namespace too, it seems yo

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread David Miller
From: Pavel Emelyanov <[EMAIL PROTECTED]> Date: Tue, 09 Oct 2007 16:19:25 +0400 > Currently indexes for netdevices come sequentially one by > one, and the same stays true even for devices that are > created for namespaces. > > Side effects of this are: > * lo device has not 1 index in a namespa

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread David Miller
From: [EMAIL PROTECTED] (Eric W. Biederman) Date: Tue, 09 Oct 2007 11:43:58 -0600 > David Stevens <[EMAIL PROTECTED]> writes: > > > Sorry if this is a dumb question, but what is the model you intend for > > SNMP? Do you want each namespace to be its own virtual machine with > > its own, separate

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread Eric W. Biederman
David Stevens <[EMAIL PROTECTED]> writes: > Sorry if this is a dumb question, but what is the model you intend for > SNMP? Do you want each namespace to be its own virtual machine with > its own, separate MIB? Each network namespace appears to user space as a completely separate network stack. S

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread Eric W. Biederman
Pavel Emelyanov <[EMAIL PROTECTED]> writes: > Currently indexes for netdevices come sequentially one by > one, and the same stays true even for devices that are > created for namespaces. > > Side effects of this are: > * lo device has not 1 index in a namespace. This may break >some userspac

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread David Stevens
Sorry if this is a dumb question, but what is the model you intend for SNMP? Do you want each namespace to be its own virtual machine with its own, separate MIB? Ifindex's have to uniquely identify the interface (virtual or otherwise) to remote queriers (not just local applications), so unless yo

Re: [PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread Daniel Lezcano
Pavel Emelyanov wrote: Currently indexes for netdevices come sequentially one by one, and the same stays true even for devices that are created for namespaces. Side effects of this are: * lo device has not 1 index in a namespace. This may break some userspace that relies on it (and AFAIR s

[PATCH][NETNS] Make ifindex generation per-namespace

2007-10-09 Thread Pavel Emelyanov
Currently indexes for netdevices come sequentially one by one, and the same stays true even for devices that are created for namespaces. Side effects of this are: * lo device has not 1 index in a namespace. This may break some userspace that relies on it (and AFAIR something really broke i