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 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

Use %pRDP instead.

> address-family ipv6 vpn
>  network ff01::/64 rd 75:5 label 7
>  network ff01::/64 rd 85:5 label 8

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
louis-6wind committed Apr 16, 2024
1 parent 84d1fb1 commit d2131dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
9 changes: 3 additions & 6 deletions bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -6646,8 +6646,6 @@ static void bgp_static_free(struct bgp_static *bgp_static)
XFREE(MTYPE_ROUTE_MAP_NAME, bgp_static->rmap.name);
route_map_counter_decrement(bgp_static->rmap.map);

if (bgp_static->prd_pretty)
XFREE(MTYPE_BGP_NAME, bgp_static->prd_pretty);
XFREE(MTYPE_ATTR, bgp_static->eth_s_id);
XFREE(MTYPE_BGP_STATIC, bgp_static);
}
Expand Down Expand Up @@ -15965,8 +15963,7 @@ static void bgp_config_write_network_vpn(struct vty *vty, struct bgp *bgp,
/* "network" configuration display. */
label = decode_label(&bgp_static->label);

vty_out(vty, " network %pFX rd %s", p,
bgp_static->prd_pretty);
vty_out(vty, " network %pFX rd %pRDP", p, &bgp_static->prd);
if (safi == SAFI_MPLS_VPN)
vty_out(vty, " label %u", label);

Expand Down Expand Up @@ -16042,8 +16039,8 @@ static void bgp_config_write_network_evpn(struct vty *vty, struct bgp *bgp,
&bgp_static->gatewayIp.u.prefix, buf2,
sizeof(buf2));
vty_out(vty,
" network %s rd %s ethtag %u label %u esi %s gwip %s routermac %s\n",
buf, bgp_static->prd_pretty,
" network %s rd %pRDP ethtag %u label %u esi %s gwip %s routermac %s\n",
buf, &bgp_static->prd,
p->u.prefix_evpn.prefix_addr.eth_tag,
decode_label(&bgp_static->label), esi_buf, buf2,
macrouter);
Expand Down
1 change: 0 additions & 1 deletion bgpd/bgp_route.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@ struct bgp_static {

/* Route Distinguisher */
struct prefix_rd prd;
char *prd_pretty;

/* MPLS label. */
mpls_label_t label;
Expand Down

0 comments on commit d2131dc

Please sign in to comment.