batman-adv: Handle parent interfaces in a different netns
authorAndrew Lunn <andrew@lunn.ch>
Sun, 3 Jul 2016 11:31:33 +0000 (13:31 +0200)
committerSimon Wunderlich <sw@simonwunderlich.de>
Tue, 9 Aug 2016 05:54:35 +0000 (07:54 +0200)
commit275019d2f00ed93e800f505a7b6f9e8ecf396898
tree2040cd321481499668914820fb7a34c49e939db7
parentb5dcbad25219b82408e15e6d775a406be2116af1
batman-adv: Handle parent interfaces in a different netns

batman-adv tries to prevent the user from placing a batX soft
interface into another batman mesh as a hard interface. It does this
by walking up the devices list of parents and ensures they are all
none batX interfaces. iflink can point to an interface in a different
namespace, so also retrieve the parents name space when finding the
parent and use it when doing the comparison.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
[sven@narfation.org: Fix alignments, simplify parent netns retrieval]
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
net/batman-adv/hard-interface.c