]> git.puffer.fish Git - matthieu/frr.git/commitdiff
staticd: fix display of the "nexthop-vrf" parameter of static routes
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 11 Sep 2020 00:27:48 +0000 (21:27 -0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 6 Oct 2020 12:54:24 +0000 (15:54 +0300)
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>
staticd/static_vty.c

index 9ebc134820f90bf04c2c09233712cf8e2ccdbace..48216715547dad6eee19798fcc3fce43bd99817f 100644 (file)
@@ -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);