Commit graph

9 commits

Author SHA1 Message Date
David Lamparter acddc0ed3c *: auto-convert to SPDX License IDs
Done with a combination of regex'ing and banging my head against a wall.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-02-09 14:09:11 +01:00
Philippe Guibert 289b0f0dfd zebra: dynamically detect vxlan link interfaces in other netns
this is used when parsing the newly network namespaces. actually, to
track the link of some interfaces like vxlan interfaces, both link index
and link nsid are necessary. if a vxlan interface is moved to a new
netns, the link information is in the default network namespace, then
LINK_NSID is the value of the netns by default in the new netns. That
value of the default netns in the new netns is not known, because the
system does not automatically assign an NSID of default network
namespace in the new netns. Now a new NSID of default netns, seen from
that new netns, is created. This permits to store at netns creation the
default netns relative value for further usage.
Because the default netns value is set from the new netns perspective,
it is not needed anymore to use the NETNSA_TARGET_NSID attribute only
available in recent kernels.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-09-11 18:26:23 +02:00
Philippe Guibert 2d4e4d39b7 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>
2020-08-18 09:25:06 -07:00
Pat Ruddy bd23c84036 evpn-netns: Revert PR5077, has been re-worked post-refactor
Revert "zebra: support for macvlan interfaces"

This reverts commit bf69e212fd.

Revert "doc: add some documentation about bgp evpn netns support"

This reverts commit 89b97c33d7.

Revert "zebra: dynamically detect vxlan link interfaces in other netns"

This reverts commit de0ebb2540.

Revert "bgpd: sanity check when updating nexthop from bgp to zebra"

This reverts commit ee9633ed87.

Revert "lib, zebra: reuse and adapt ns_list walk functionality"

This reverts commit c4d466c830.

Revert "zebra: local mac entries populated in correct netnamespace"

This reverts commit 4042454891.

Revert "zebra: when parsing local entry against dad, retrieve config"

This reverts commit 3acc394bc5.

Revert "bgpd: evpn nexthop can be changed by default"

This reverts commit a2342a2412.

Revert "zebra: zvni_map_to_vlan() adaptation for all namespaces"

This reverts commit db81d18647.

Revert "zebra: add ns_id attribute to mac structure"

This reverts commit 388d5b438e.

Revert "zebra: bridge layer2 information records ns_id where bridge is"

This reverts commit b5b453a2d6.

Revert "zebra, lib: new API to get absolute netns val from relative netns val"

This reverts commit b6ebab34f6.

Revert "zebra, lib: store relative default ns id in each namespace"

This reverts commit 9d3555e06c.

Revert "zebra, lib: add an internal API to get relative default nsid in other ns"

This reverts commit 97c9e7533b.

Revert "zebra: map vxlan interface to bridge interface with correct ns id"

This reverts commit 7c990878f2.

Revert "zebra: fdb and neighbor table are read for all zns"

This reverts commit f8ed2c5420.

Revert "zebra: zvni_map_to_svi() adaptation for other network namespaces"

This reverts commit 2a9dccb647.

Revert "zebra: display interface slave type"

This reverts commit fc3141393a.

Revert "zebra: zvni_from_svi() adaptation for other network namespaces"

This reverts commit 6fe516bd4b.

Revert "zebra: importation of bgp evpn rt5 from vni with other netns"

This reverts commit 28254125d0.

Revert "lib, zebra: update interface name at netlink creation"

This reverts commit 1f7a68a2ff.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-08-05 06:46:12 -07:00
Philippe Guibert de0ebb2540 zebra: dynamically detect vxlan link interfaces in other netns
this is used when parsing the newly network namespaces. actually, to
track the link of some interfaces like vxlan interfaces, both link index
and link nsid are necessary. if a vxlan interface is moved to a new
netns, the link information is in the default network namespace, then
LINK_NSID is the value of the netns by default in the new netns. That
value of the default netns in the new netns is not known, because the
system does not automatically assign an NSID of default network
namespace in the new netns. Now a new NSID of default netns, seen from
that new netns, is created. This permits to store at netns creation the
default netns relative value for further usage.
Because the default netns value is set from the new netns perspective,
it is not needed anymore to use the NETNSA_TARGET_NSID attribute only
available in recent kernels.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2020-05-18 14:11:03 +02:00
Philippe Guibert 97c9e7533b 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>
2020-05-18 14:11:03 +02:00
Emanuele Di Pascale 51e94aa7b1 add cplusplus guards to all zebra headers
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-03-25 16:05:27 +01:00
Philippe Guibert ec31f30d28 zebra: upon startup, a NSID is assigned to default netns
when the netns backend is selected for VRF, the default VRF is being
assigned a NSID. This avoids the need to handle the case where if the
incoming NSID was 0 for a non default VRF, then a specific handling had
to be done to keep 0 value for default VRF.
In most cases, as the first NETNS to get a NSID will be the default VRF,
most probably the default VRF will be assigned to 0, while the other
ones will have their value incremented. On some cases, where the NSID is
already assigned for NETNS, including default VRF, then the default VRF
value will be the one derived from the NSID of default VRF, thus keeping
consistency between VRF IDs and NETNS IDs.
Default NS is attempted to be created. Actually, some VMs may have the
netns feature, but the NS initialisation fails because that folder is
not present.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-27 11:11:24 +01:00
Philippe Guibert 05895ad0be zebra: upon NS creation, collect the NSID via netlink
A NS identifier is collected by netlink. This identifier is a 32 bit
identifier that is either generated by the kernel (if not set) or
manually set by a set netlink command. The commit here is getting the
NSID from the newly created NS. If the linux option to create or get a
new NSID from the kernel does not exist, then the NSID is locally
genrated.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-02-27 11:11:24 +01:00