]> git.puffer.fish Git - mirror/frr.git/commit
lib: fix handle seg6local routes on default vrf 13303/head
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 14 Apr 2023 08:44:41 +0000 (10:44 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 14 Apr 2023 10:17:10 +0000 (12:17 +0200)
commitc37812dd2a13857863756765a24b0cd2415736c4
treeec57bcff5054c7a3d169f5f3f56041be2166935e
parent89f0982149b90940044130480de267f33a049b3f
lib: fix handle seg6local routes on default vrf

An L3VPN network can be configured on the main BGP instance,
with an SRv6 SID. By declaring a network, a seg6local route
is created but remains invalid.

The below BGP VPN configuration the default VRF has been
used:
> router bgp 1
>  address-family ipv6 unicast
>   sid vpn export auto
>   rd vpn export 1:30
>   rt vpn both 77:77
>   import vpn
>   export vpn
>   network 2001:7::/64
>  exit-address-family

The below seg6local route has been added:

> # show ipv6 route
> [..]
> B   2001:db8:2:2:300::/128 [20/0] is directly connected, unknown inactive, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:07
>

When creating the seg6local route, an interface is used as nexthop.
The interface index is obtained from the vrf identifier. This is
true when using VRF interfaces, but is wrong when using the lo
interface which usually has the '1' ifindex whereas the vrf id for
the default VRF is 0.

Get the appropriate index from the vrf identifier.
The below seg6local route is visible:

> # show ipv6 route
> [..]
> B>* 2001:db8:1:1:300::/128 [20/0] is directly connected, lo, seg6local End.DT6 table 254, seg6 ::, weight 1, 00:00:15
>

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
lib/zclient.c
lib/zclient.h