Skip to content

Commit 7cc6b6b

Browse files
author
Dmitrii Turlupov
committed
staticd: Fix bfd for static route in VRF
vrf BELLA ip route 1.1.1.1/32 192.168.1.1 bfd profile test exit-vrf Before patch: # do show bfd peers BFD Peers: peer 192.168.1.1 vrf default After patch: # do show bfd peers BFD Peers: peer 192.168.1.1 vrf BELLA Signed-off-by: Dmitrii Turlupov <[email protected]>
1 parent 3cbc715 commit 7cc6b6b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

staticd/static_bfd.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,15 @@ void static_next_hop_bfd_monitor_enable(struct static_nexthop *sn,
8888
bool mhop;
8989
int family;
9090
struct ipaddr source;
91+
struct vrf *vrf = NULL;
9192

9293
use_interface = false;
9394
use_source = yang_dnode_exists(dnode, "./source");
9495
use_profile = yang_dnode_exists(dnode, "./profile");
9596
onlink = yang_dnode_exists(dnode, "../onlink") &&
9697
yang_dnode_get_bool(dnode, "../onlink");
9798
mhop = yang_dnode_get_bool(dnode, "./multi-hop");
98-
99+
vrf = vrf_lookup_by_name(yang_dnode_get_string(dnode, "../vrf"));
99100

100101
family = static_next_hop_type_to_family(sn);
101102
if (family == AF_UNSPEC)
@@ -133,6 +134,8 @@ void static_next_hop_bfd_monitor_enable(struct static_nexthop *sn,
133134
bfd_sess_set_profile(sn->bsp, use_profile ? yang_dnode_get_string(
134135
dnode, "./profile")
135136
: NULL);
137+
if (vrf && vrf->vrf_id != VRF_UNKNOWN)
138+
bfd_sess_set_vrf(sn->bsp, vrf->vrf_id);
136139

137140
bfd_sess_set_hop_count(sn->bsp, (onlink || mhop == false) ? 1 : 254);
138141

0 commit comments

Comments
 (0)