summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorFeng Lu <lu.feng@6wind.com>2015-05-22 11:40:02 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2015-06-02 07:46:17 +0200
commit0d0686f98e64017415071e590bde262f0ab5a4c9 (patch)
treea8ffef2548d24ce9a7662a20573d2a26a8e17142 /zebra/zebra_vty.c
parenta2854770ff839553c9444193e84a1593645fa848 (diff)
downloadquagga-0d0686f98e64017415071e590bde262f0ab5a4c9.tar.bz2
quagga-0d0686f98e64017415071e590bde262f0ab5a4c9.tar.xz
zebra: let FIB stand for its respective VRF
A new member "vrf_id" is added to "struct rib", reflecting the VRF which it belongs to. A new parameter "vrf_id" is added to the relative functions where need, except those: - which already have the parameter "vrf_id"; or - which have a parameter in type of "struct rib"; or - which have a parameter in type of "struct interface". All incoming routes are set to default VRF. In fact, all routes in FIB are kept in default VRF. And the logic is not changed. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> [DL: conflicts fixed + compile warning fix] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index a4e6af78..78e73669 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -285,7 +285,7 @@ DEFUN (show_ip_rpf_addr,
return CMD_WARNING;
}
- rib = rib_match_ipv4_multicast (addr, &rn);
+ rib = rib_match_ipv4_multicast (addr, &rn, VRF_DEFAULT);
if (rib)
vty_show_ip_route_detail (vty, rn, 1);
@@ -771,7 +771,8 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
case NEXTHOP_TYPE_IPV4_IFINDEX:
vty_out (vty, " %s", inet_ntoa (nexthop->gate.ipv4));
if (nexthop->ifindex)
- vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex));
+ vty_out (vty, ", via %s",
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IPV6:
case NEXTHOP_TYPE_IPV6_IFINDEX:
@@ -781,11 +782,12 @@ vty_show_ip_route_detail (struct vty *vty, struct route_node *rn, int mcast)
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
vty_out (vty, ", %s", nexthop->ifname);
else if (nexthop->ifindex)
- vty_out (vty, ", via %s", ifindex2ifname (nexthop->ifindex));
+ vty_out (vty, ", via %s",
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IFINDEX:
vty_out (vty, " directly connected, %s",
- ifindex2ifname (nexthop->ifindex));
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IFNAME:
vty_out (vty, " directly connected, %s", nexthop->ifname);
@@ -876,7 +878,8 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
case NEXTHOP_TYPE_IPV4_IFINDEX:
vty_out (vty, " via %s", inet_ntoa (nexthop->gate.ipv4));
if (nexthop->ifindex)
- vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex));
+ vty_out (vty, ", %s",
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IPV6:
case NEXTHOP_TYPE_IPV6_IFINDEX:
@@ -886,11 +889,12 @@ vty_show_ip_route (struct vty *vty, struct route_node *rn, struct rib *rib)
if (nexthop->type == NEXTHOP_TYPE_IPV6_IFNAME)
vty_out (vty, ", %s", nexthop->ifname);
else if (nexthop->ifindex)
- vty_out (vty, ", %s", ifindex2ifname (nexthop->ifindex));
+ vty_out (vty, ", %s",
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IFINDEX:
vty_out (vty, " is directly connected, %s",
- ifindex2ifname (nexthop->ifindex));
+ ifindex2ifname_vrf (nexthop->ifindex, rib->vrf_id));
break;
case NEXTHOP_TYPE_IFNAME:
vty_out (vty, " is directly connected, %s", nexthop->ifname);