Skip to content

Commit

Permalink
bgpd: use %pRDP for printing evpn rd
Browse files Browse the repository at this point in the history
Use %pRDP for printing evpn rd

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
louis-6wind committed Apr 16, 2024
1 parent d2131dc commit 85b54f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
4 changes: 0 additions & 4 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -6221,8 +6221,6 @@ void bgp_evpn_derive_auto_rd(struct bgp *bgp, struct bgpevpn *vpn)
vpn->prd.prefixlen = 64;
snprintfrr(buf, sizeof(buf), "%pI4:%hu", &bgp->router_id, vpn->rd_id);
(void)str2prefix_rd(buf, &vpn->prd);
if (vpn->prd_pretty)
XFREE(MTYPE_BGP_NAME, vpn->prd_pretty);
UNSET_FLAG(vpn->flags, VNI_FLAG_RD_CFGD);
}

Expand Down Expand Up @@ -6338,8 +6336,6 @@ void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn)
bf_release_index(bm->rd_idspace, vpn->rd_id);
hash_release(bgp->vni_svi_hash, vpn);
hash_release(bgp->vnihash, vpn);
if (vpn->prd_pretty)
XFREE(MTYPE_BGP_NAME, vpn->prd_pretty);
QOBJ_UNREG(vpn);
XFREE(MTYPE_BGP_EVPN, vpn);
}
Expand Down
1 change: 0 additions & 1 deletion bgpd/bgp_evpn_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ struct bgpevpn {

/* RD for this VNI. */
struct prefix_rd prd;
char *prd_pretty;

/* Route type 3 field */
struct in_addr originator_ip;
Expand Down
3 changes: 1 addition & 2 deletions bgpd/bgp_evpn_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,6 @@ static void evpn_configure_rd(struct bgp *bgp, struct bgpevpn *vpn,

/* update RD */
memcpy(&vpn->prd, rd, sizeof(struct prefix_rd));
vpn->prd_pretty = XSTRDUP(MTYPE_BGP_NAME, rd_pretty);
SET_FLAG(vpn->flags, VNI_FLAG_RD_CFGD);

if (is_vni_live(vpn))
Expand Down Expand Up @@ -3563,7 +3562,7 @@ static void write_vni_config(struct vty *vty, struct bgpevpn *vpn)
if (is_vni_configured(vpn)) {
vty_out(vty, " vni %u\n", vpn->vni);
if (is_rd_configured(vpn))
vty_out(vty, " rd %s\n", vpn->prd_pretty);
vty_out(vty, " rd %pRDP\n", &vpn->prd);

if (is_import_rt_configured(vpn)) {
for (ALL_LIST_ELEMENTS(vpn->import_rtl, node, nnode,
Expand Down

0 comments on commit 85b54f9

Please sign in to comment.