From: Lou Berger Date: Sun, 29 Jan 2017 13:15:23 +0000 (-0500) Subject: bgpd rfapi: fix UN address in show with MPLS TT X-Git-Tag: frr-2.0-rc2~25^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=144b5c111f8a1e844d5adbe9fe366d12be1d54ee;p=mirror%2Ffrr.git bgpd rfapi: fix UN address in show with MPLS TT Signed-off-by: Lou Berger --- diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 1118cfd76f..0a5ee9428d 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -1174,16 +1174,18 @@ rfapiPrintRemoteRegBi ( inet_ntop (pfx_un.family, &pfx_un.u.prefix, buf_ntop, BUFSIZ)); } - buf_un[BUFSIZ - 1] = 0; rfapiGetTunnelType(bi->attr,&tun_type); /* * VN addr */ buf_vn[0] = 0; + rfapiNexthop2Prefix (bi->attr, &pfx_vn); if (tun_type == BGP_ENCAP_TYPE_MPLS) { /* MPLS carries un in nrli next hop (same as vn for IP tunnels) */ + snprintf (buf_un, BUFSIZ, "%s", + inet_ntop (pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); if (bi->extra) { u_int32_t l = decode_label (bi->extra->tag); @@ -1196,13 +1198,12 @@ rfapiPrintRemoteRegBi ( } else { - rfapiNexthop2Prefix (bi->attr, &pfx_vn); snprintf (buf_vn, BUFSIZ, "%s", inet_ntop (pfx_vn.family, &pfx_vn.u.prefix, buf_ntop, BUFSIZ)); } buf_vn[BUFSIZ - 1] = 0; + buf_un[BUFSIZ - 1] = 0; - /* * Cost is encoded in local_pref as (255-cost) * See rfapi_import.c'rfapiRouteInfo2NextHopEntry() for conversion