This patchset makes batman-adv network namespace aware. A soft interface can be creates in a namespace and hard interfaces added to it. soft interfaces cannot be moved between name spaces.
The biggest change is to debugfs, which is not natively netns aware, unlike sysfs which is. A new netns directory has been added and within that, a directory per network name space which batman is used within. The changes are backwards compatible, in that interfaces in the global namespace are not placed into a subdirectory.
/sys/kernel/debug/batman_adv ├── eth0 │ └── originators ├── eth1 │ └── originators ├── eth2 │ └── originators ├── netns │ ├── 4026531957 -> .. │ ├── 4026532176 │ │ ├── bat0 │ │ │ ├── bla_backbone_table │ │ │ ├── bla_claim_table │ │ │ ├── dat_cache │ │ │ ├── gateways │ │ │ ├── nc │ │ │ │ ├── max_buffer_time │ │ │ │ ├── max_fwd_delay │ │ │ │ └── min_tq │ │ │ ├── nc_nodes │ │ │ ├── originators │ │ │ ├── socket │ │ │ ├── transtable_global │ │ │ └── transtable_local │ │ ├── emu1-veth1 │ │ │ └── originators │ │ └── emu1-veth2 │ │ └── originators │ ├── 4026532225 │ │ ├── bat0 │ │ │ ├── bla_backbone_table │ │ │ ├── bla_claim_table │ │ │ ├── dat_cache │ │ │ ├── gateways │ │ │ ├── nc │ │ │ │ ├── max_buffer_time │ │ │ │ ├── max_fwd_delay │ │ │ │ └── min_tq │ │ │ ├── nc_nodes │ │ │ ├── originators │ │ │ ├── socket │ │ │ ├── transtable_global │ │ │ └── transtable_local │ │ ├── emu2-veth1 │ │ │ └── originators │ │ └── emu2-veth2 │ │ └── originators
Patches are available for batctl and alfred, to make use of this new structure.
The bat-over-bat detection has been enhanced, so that it is also netns aware. It can also now cope with veth interfaces which are mutual parents.
Andrew Lunn (4): batman-adv: NETIF_F_NETNS_LOCAL feature to prevent netns moves batman-adv: Create batman soft interfaces within correct netns. batman-adv: Handle parent interfaces in a different netns batman-adv: debugfs: Add netns support
net/batman-adv/debugfs.c | 118 ++++++++++++++++++++++++++++++++++++- net/batman-adv/hard-interface.c | 49 +++++++++++++-- net/batman-adv/hard-interface.h | 2 +- net/batman-adv/soft-interface.c | 9 ++- net/batman-adv/soft-interface.h | 2 +- net/batman-adv/sysfs.c | 3 +- net/batman-adv/translation-table.c | 3 +- 7 files changed, 172 insertions(+), 14 deletions(-)