From: Louis Scalbert Date: Tue, 16 Apr 2024 14:41:51 +0000 (+0200) Subject: bgpd: fix show run of network route-distinguisher X-Git-Tag: docker/10.0.1~32^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=16600df2c4f4baef9b8745b857aea8948f96ccb2;p=mirror%2Ffrr.git bgpd: fix show run of network route-distinguisher Route-distinguisher (RD) is not printed properly in show run: > address-family ipv6 vpn > network ff01::/64 rd (null) label 7 > network ff01::/64 rd (null) label 8 ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") merged bgp_static_set_safi into bgp_static_set but inadvertently omitted the handling of prd_pretty. Copy the pretty RD string if available. > address-family ipv6 vpn > network ff01::/64 rd 75:5 label 7 > network ff01::/64 rd 85:5 label 8 Fixes: ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") Signed-off-by: Louis Scalbert (cherry picked from commit 3d3a138f5a177a2ef5996c17c76c4f7778f9c3aa) --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index bcf56d2e6a..a69d6ee9f0 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -6842,6 +6842,10 @@ int bgp_static_set(struct vty *vty, bool negate, const char *ip_str, bgp_static->label = label; bgp_static->prd = prd; + if (rd_str) + bgp_static->prd_pretty = XSTRDUP(MTYPE_BGP, + rd_str); + if (rmap) { XFREE(MTYPE_ROUTE_MAP_NAME, bgp_static->rmap.name);