summaryrefslogtreecommitdiff
path: root/ospfclient/ospfclient.py
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2023-01-12 08:44:29 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2023-05-09 21:00:57 +0200
commit7bae48960e08a6f57b458a2db51cf92ecbf76733 (patch)
tree584f6a088a0e1de00f485d5da9fe8da05710a850 /ospfclient/ospfclient.py
parentbd21ba79aa13b7421baaa09335901c1dafeb158a (diff)
zebra: handle nexthop vrf_id in ZEBRA_MPLS_LABELS messages
This commit addresses the case where a service wants to install an LSP entry to a next-hop located in a VRF instance. The incoming MPLS packet is on the namespace and has to be directed to a nexthop located behind an interface that sits in a specific VRF instance. The below iproute command can illustrate: > ip link add vrf1 type vrf table 10 > ip link set dev vrf1 up > ip link set dev eth0 master vrf1 > ip a a 192.0.2.1/24 dev eth0 > ip -f mpls route add 105 via inet 192.0.2.45 dev eth0 If a service uses the ZEBRA_MPLS_LABELS messages, then the LSP message is ignored: from zebra perspective, the MPLS entries are visible via the 'show mpls table' command, but no LSP entry is installed in the kernel. The issue is in the nhlfe_nexthop_active_ipv[4/6] function: the outgoing interface mentioned in the nexthop is searched in the main VRF, whereas the interface is in a separate VRF. The interface is not found, and the nhlfe to install is considered not active. To address this issue, reuse the incoming vrf_id parameter transmitted in the nexthop structure from the ZEBRA_MPLS_LABELS message. When creating an NHLFE entry, the vrf_id is used instead of the DEFAULT_VRF. And the nhlfe entry can be considered as active. One alternate solution to reuse the vrf_id parameter in the mpls network context would be to modify the search function in nhlfe_nexthop_active..() function: looking for an existing ifindex in the zns. However, this solution may not fit later when netns backend would be used. Note that some changes have not been done yet and are considered sufficient for now: - The 'nhlfe_find' API: the assumption is done that only the linux vrf backend is used for now. - The 'mpls_lsp_install()' API: It is currently used by the CLI command which does not handle the interface parameter, and the SRTE service, whih always sends LSPs towards a nexthop located in the VRF_DEFAULT. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'ospfclient/ospfclient.py')
0 files changed, 0 insertions, 0 deletions