]> git.puffer.fish Git - matthieu/frr.git/commit
zebra: Add link_nsid to zebra interface
authorXiao Liang <shaw.leon@gmail.com>
Tue, 21 Feb 2023 06:00:36 +0000 (14:00 +0800)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 11 Apr 2023 21:39:31 +0000 (21:39 +0000)
commit6803b66491385aee8b21fdcf7643179ff02f593f
tree442c6026d0bea4fe525d4419264a5ea5d75a4cac
parente2b142325f9ce310810dea55d808cc9ec53d47cc
zebra: Add link_nsid to zebra interface

Create VRF and interfaces:

    ip netns add vrf1
    ip link add veth1 index 100 type veth
    ip link add link veth1 veth1.200 type vlan id 200
    ip link set veth1.200 netns vrf1
    ip -n vrf1 link add veth2 index 100 type veth

After reloading zebra, "show interface veth1.200" shows wrong parent
interface:

    test# show interface veth1.200
    Interface veth1.200 is down
      ...
      Parent interface: veth2

This is because veth1.200 and veth1 are in different netns, and veth2
happens to have the same ifindex as veth1, in the same netns of
veth1.200.
When looking for parent, link-ifindex 100 should be looked up within
link-netns, rather than that of the child interface.

Add link_nsid to zebra interface, so that the <link_nsid, link_ifindex>
pair can uniquely identify the link interface.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
(cherry picked from commit af19624b005452dbaf25215ba371e35f61835e03)
zebra/interface.c
zebra/interface.h