Skip to content

Commit

Permalink
bgpd: fix show run of network route-distinguisher
Browse files Browse the repository at this point in the history
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

ad151f6 ("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: ad151f6 ("bgpd: Refactor bgp_static_set/bgp_static_set_safi")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 3d3a138)
  • Loading branch information
louis-6wind authored and mergify[bot] committed Apr 24, 2024
1 parent 147e933 commit 16600df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 16600df

Please sign in to comment.