summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-09-10 21:27:48 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-09-11 15:13:22 -0300
commit0d0aacea9590bcd08aa4f6622b9f54dba1902250 (patch)
tree2027acfdbbe80274d7aeb07deef422930402335a
parent406537cb703c652ec275ae7e824efb2009634837 (diff)
staticd: fix display of the "nexthop-vrf" parameter of static routes
When the static route VRF and its nexthop VRF are inactive in the kernel, both VRFs will have the same ID (VRF_UNKNOWN) even though they might not be the same. This can cause "sh run" to not display the "nexthop-vrf" parameter correctly when necessary. Change the code to compare VRFs by their names to fix this problem. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r--staticd/static_vty.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c
index 9ebc134820..4821671554 100644
--- a/staticd/static_vty.c
+++ b/staticd/static_vty.c
@@ -423,7 +423,8 @@ int static_config(struct vty *vty, struct static_vrf *svrf, afi_t afi,
nh->snh_label.label,
buf, sizeof(buf), 0));
- if (nh->nh_vrf_id != GET_STABLE_VRF_ID(info))
+ if (!strmatch(nh->nh_vrfname,
+ info->svrf->vrf->name))
vty_out(vty, " nexthop-vrf %s",
nh->nh_vrfname);