summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Courtat <julien.courtat@6wind.com>2016-10-18 11:05:26 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2017-02-14 13:58:58 +0100
commitdc49391e3605756121de147d0557a7d4ef54a09c (patch)
treefa250a2a1d61a5bbd597ee63d846c0ba6d2f2e22
parent784d3a4299eef5f663bb6da4b6e52bf6a6e17d68 (diff)
bgpd: fix display of ethernet vpn route prefix in vty
L2VPN route prefix are composed of ethtag, mac address and ip address. vty command "show bgp l2vpn rd <>" show macip prefix in the following template: [ethtag][macaddress/len][ipaddress/len] Signed-off-by: Julien Courtat <julien.courtat@6wind.com> e
-rw-r--r--bgpd/bgp_route.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 7aee689d9c..9145a9af73 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5886,6 +5886,11 @@ route_vty_out_route (struct prefix *p, struct vty *vty)
else
len += vty_out (vty, "/%d", p->prefixlen);
}
+ else if (p->family == AF_ETHERNET)
+ {
+ prefix2str(p, buf, PREFIX_STRLEN);
+ len = vty_out (vty, "%s", buf);
+ }
else
len = vty_out (vty, "%s/%d", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
p->prefixlen);
@@ -7837,11 +7842,15 @@ route_vty_out_detail_header (struct vty *vty, struct bgp *bgp,
}
else
{
+ if (p->family == AF_ETHERNET)
+ prefix2str (p, buf2, INET6_ADDRSTRLEN);
+ else
+ inet_ntop (p->family, &p->u.prefix, buf2, INET6_ADDRSTRLEN);
vty_out (vty, "BGP routing table entry for %s%s%s/%d%s",
((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP || safi == SAFI_EVPN) ?
prefix_rd2str (prd, buf1, RD_ADDRSTRLEN) : ""),
((safi == SAFI_MPLS_VPN) || (safi == SAFI_EVPN)) ? ":" : "",
- inet_ntop (p->family, &p->u.prefix, buf2, INET6_ADDRSTRLEN),
+ buf2,
p->prefixlen, VTY_NEWLINE);
}