]> git.puffer.fish Git - mirror/frr.git/commit
zebra, lib: add an internal API to get relative default nsid in other ns
authorPhilippe Guibert <philippe.guibert@6wind.com>
Wed, 2 Oct 2019 10:14:13 +0000 (12:14 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 21 Sep 2020 07:17:10 +0000 (09:17 +0200)
commit83ef3b15914b7c9bb1f8db97e22e15acdac7639a
tree895a9855e1ec5aca962bf6ff9074e858c8ac06b9
parentf8360222d4af143839cc0d312c15b9eee528f843
zebra, lib: add an internal API to get relative default nsid in other ns

as remind, the netns identifiers are local to a namespace. that is to
say that for instance, a vrf <vrfx> will have a netns id value in one
netns, and have an other netns id value in one other netns.
There is a need for zebra daemon to collect some cross information, like
the LINK_NETNSID information from interfaces having link layer in an
other network namespace. For that, it is needed to have a global
overview instead of a relative overview per namespace.
The first brick of this change is an API that sticks to netlink API,
that uses NETNSA_TARGET_NSID. from a given vrf vrfX, and a new vrf
created vrfY, the API returns the value of nsID from vrfX, inside the
new vrf vrfY.
The brick also gets the ns id value of default namespace in each other
namespace. An additional value in ns.h is offered, that permits to
retrieve the default namespace context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
include/linux/net_namespace.h
lib/netns_linux.c
lib/ns.h
zebra/zebra_netns_id.c
zebra/zebra_netns_id.h
zebra/zebra_netns_notify.c