]> 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)
committerXiao Liang <shaw.leon@gmail.com>
Wed, 8 Mar 2023 01:57:18 +0000 (09:57 +0800)
commitaf19624b005452dbaf25215ba371e35f61835e03
tree349d054feabed05f52018b29e13cbfeb5c3d6f10
parente618cc7b21608c493ec321caf2377771c6c4baba
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>
zebra/interface.c
zebra/interface.h