bgpd rfapi: use VN as nexthop for MPLS tunnels too

Also minor show format cleanup

Signed-off-by: Lou Berger <lberger@labn.net>
This commit is contained in:
Lou Berger 2017-01-13 10:18:48 -05:00
parent 4c6f219aa2
commit 764581d286
4 changed files with 3 additions and 15 deletions

View File

@ -768,7 +768,6 @@ add_vnc_route (
bgp_attr_extra_free (&attr); bgp_attr_extra_free (&attr);
return; return;
} }
nexthop = un_addr; /* UN used as MPLS NLRI nexthop */
} }
if (local_pref) if (local_pref)

View File

@ -131,8 +131,7 @@ rfapi_tunneltype_option_to_tlv (
break; break;
case BGP_ENCAP_TYPE_MPLS: case BGP_ENCAP_TYPE_MPLS:
_RTTO_MAYBE_ADD_ENDPOINT_ADDRESS (mpls); /* nothing to do for MPLS */
bgp_encap_type_mpls_to_tlv (&tto->bgpinfo.mpls, attr);
break; break;
case BGP_ENCAP_TYPE_MPLS_IN_GRE: case BGP_ENCAP_TYPE_MPLS_IN_GRE:

View File

@ -423,10 +423,7 @@ rfapiGetVncTunnelUnAddr (struct attr *attr, struct prefix *p)
rfapiGetTunnelType (attr, &tun_type); rfapiGetTunnelType (attr, &tun_type);
if (p && tun_type == BGP_ENCAP_TYPE_MPLS) if (p && tun_type == BGP_ENCAP_TYPE_MPLS)
{ {
/* MPLS carries UN address in next hop */ return ENOENT; /* no UN for MPLS */
rfapiNexthop2Prefix (attr, p);
if (p->family != 0)
return 0;
} }
if (attr && attr->extra) if (attr && attr->extra)
{ {

View File

@ -490,14 +490,7 @@ rfapi_vty_out_vncinfo (
if (bi->extra != NULL) if (bi->extra != NULL)
vty_out (vty, " label=%u", decode_label (bi->extra->tag)); vty_out (vty, " label=%u", decode_label (bi->extra->tag));
if (rfapiGetVncLifetime (bi->attr, &lifetime)) if (!rfapiGetVncLifetime (bi->attr, &lifetime))
{
if (safi == SAFI_MPLS_VPN || safi == SAFI_ENCAP)
{
vty_out (vty, " life=none");
}
}
else
{ {
vty_out (vty, " life=%d", lifetime); vty_out (vty, " life=%d", lifetime);
} }