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-3.0-branchpoint~55^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=def3f4e94250a4c9db1f6242a8cc1b7b8d4ac67b;p=matthieu%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 f7c3773fd4..f6aa353df3 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -1175,16 +1175,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); @@ -1197,13 +1199,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