From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Sun, 24 Jan 2016 14:19:59 +0800 From: Antonio Quartulli Message-ID: <20160124061959.GC6148@prodigo.lan> References: <1453312110-32683-1-git-send-email-andrew@lunn.ch> <1453312110-32683-2-git-send-email-andrew@lunn.ch> <20160123020637.GA32607@prodigo.lan> <20160123172006.GA3880@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160123172006.GA3880@lunn.ch> Subject: Re: [B.A.T.M.A.N.] [PATCH 1/4] batman-adv: NETIF_F_NETNS_LOCAL feature to prevent netns moves List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andrew Lunn Cc: The list for a Better Approach To Mobile Ad-hoc Networking On Sat, Jan 23, 2016 at 06:20:06PM +0100, Andrew Lunn wrote: > On Sat, Jan 23, 2016 at 10:06:37AM +0800, Antonio Quartulli wrote: > > On Wed, Jan 20, 2016 at 06:48:27PM +0100, Andrew Lunn wrote: > > > The batX soft interface should not be moved between network name > > > spaces. This is similar to bridges, bonds, tunnels, which are not > > > allowed to move between network namespaces. > > > > > > > Andrew, > > I understand bridges and other similar interfaces do the same, but what > > is the real reason for preventing a batman soft-interface from moving > > between namespaces? > > Humm, actually, a good question. I blindly copied this code without > thinking about it. > > One clear answer is the notification mechanism, used by > batadv_hard_if_event(). As far as i can see, such events are only sent > within the interfaces namespace. So for example you hot unplug a hard > interface which the soft interface is using, you would not get the > NETDEV_DOWN event if the soft interface is in a different namespace. This raises another question (maybe addressed by another of your patch?): what happens if an hard-interface currently enslaved in bat0 changes namespace? Will this result in an UNREGISTER event like when the interface gets destroyed? If not, I am not sure how the whole situation can still be consistent. > > Now that i think of it, there are a few other reasons. All the > interface management calls, and displaying of interface names would > have to contains the namespace. Otherwise you look at the output for > 'batctl o' and have no idea which namespace that wlan0 interface is > from. Remember, interface names are only unique within a namespace, > not across namespaces. Yeah, it make sense. If the softif is in the same ns as the hardifs, it is definitely necessary to prevent bat0 from jumping from a namespace to another. Cheers, -- Antonio Quartulli