bgpd: fix show bgp l2vpn evpn all tag command

This commit fixes the nexthop display behaviour when an evpn entry is
matched. The commit handles both cases where IPv4 or IPv6 nexthop is
detected.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2017-01-20 18:47:23 +01:00
parent 061e9fdea5
commit b94c6c5026

View File

@ -4137,7 +4137,6 @@ bgp_static_update_safi (struct bgp *bgp, struct prefix *p,
/* Register new BGP information. */
bgp_info_add (rn, new);
/* route_node_get lock */
bgp_unlock_node (rn);
@ -6480,8 +6479,9 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
attr = binfo->attr;
if (attr)
{
if (p->family == AF_INET
&& (safi == SAFI_MPLS_VPN || !BGP_ATTR_NEXTHOP_AFI_IP6(attr)))
if (((p->family == AF_INET) && ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)))
|| (safi == SAFI_EVPN && p->family == AF_ETHERNET && !BGP_ATTR_NEXTHOP_AFI_IP6(attr))
|| (!BGP_ATTR_NEXTHOP_AFI_IP6(attr)))
{
if (safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP || safi == SAFI_EVPN)
{
@ -6498,7 +6498,9 @@ route_vty_out_tag (struct vty *vty, struct prefix *p,
vty_out (vty, "%-16s", inet_ntoa (attr->nexthop));
}
}
else if (p->family == AF_INET6 || BGP_ATTR_NEXTHOP_AFI_IP6(attr))
else if (((p->family == AF_INET6) && ((safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)))
|| (safi == SAFI_EVPN && p->family == AF_ETHERNET && BGP_ATTR_NEXTHOP_AFI_IP6(attr))
|| (BGP_ATTR_NEXTHOP_AFI_IP6(attr)))
{
assert (attr->extra);
char buf_a[BUFSIZ];