summaryrefslogtreecommitdiff
path: root/bgpd/rfapi/rfapi_rib.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-09-22 11:17:49 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-09-22 13:12:11 +0300
commitc4f64ea94df36395889ca88c50fd198ce95bc73d (patch)
treee40b1a7fdf830a47ab702cfc39f4d35b62c2921a /bgpd/rfapi/rfapi_rib.c
parent447d0fc290fa24e5a359e425cb6ccc5c3aa3e428 (diff)
bgpd: Use %pRD for prefix_rd2str()
Convert a bunch of prefix_rd2str() for json/vty stuff. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'bgpd/rfapi/rfapi_rib.c')
-rw-r--r--bgpd/rfapi/rfapi_rib.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index 9e13c48134..50a10c3b1d 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -1104,9 +1104,6 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd,
__func__, ri);
} else {
-
- char buf_rd[RD_ADDRSTRLEN];
-
/* not found: add new route to RIB */
ori = rfapi_info_new();
ori->rk = ri->rk;
@@ -1129,16 +1126,9 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd,
}
skiplist_insert(slRibPt, &ori->rk, ori);
-#if DEBUG_RIB_SL_RD
- prefix_rd2str(&ori->rk.rd, buf_rd,
- sizeof(buf_rd));
-#else
- buf_rd[0] = 0;
-#endif
-
vnc_zlog_debug_verbose(
- "%s: nomatch lPendCost item %p in slRibPt, added (rd=%s)",
- __func__, ri, buf_rd);
+ "%s: nomatch lPendCost item %p in slRibPt, added (rd=%pRD)",
+ __func__, ri, &ori->rk.rd);
}
/*
@@ -1378,17 +1368,9 @@ callback:
0, delete_list->count);
ri->last_sent_time = monotime(NULL);
#if DEBUG_RIB_SL_RD
- {
- char buf_rd[RD_ADDRSTRLEN];
-
- vnc_zlog_debug_verbose(
- "%s: move route to recently deleted list, rd=%s",
- __func__,
- prefix_rd2str(
- &ri->rk.rd,
- buf_rd,
- sizeof(buf_rd)));
- }
+ vnc_zlog_debug_verbose(
+ "%s: move route to recently deleted list, rd=%pRD",
+ __func__, &ri->rk.rd);
#endif
} else {
@@ -2256,7 +2238,6 @@ static int print_rib_sl(int (*fp)(void *, const char *, ...), struct vty *vty,
char str_lifetime[BUFSIZ];
char str_age[BUFSIZ];
char *p;
- char str_rd[RD_ADDRSTRLEN];
++routes_displayed;
@@ -2284,14 +2265,9 @@ static int print_rib_sl(int (*fp)(void *, const char *, ...), struct vty *vty,
}
#endif
- str_rd[0] = 0; /* start empty */
-#if DEBUG_RIB_SL_RD
- prefix_rd2str(&ri->rk.rd, str_rd, sizeof(str_rd));
-#endif
-
- fp(out, " %c %-20s %-15s %-15s %-4u %-8s %-8s %s\n",
+ fp(out, " %c %-20s %-15s %-15s %-4u %-8s %-8s %pRD\n",
deleted ? 'r' : ' ', *printedprefix ? "" : str_pfx, str_vn,
- str_un, ri->cost, str_lifetime, str_age, str_rd);
+ str_un, ri->cost, str_lifetime, str_age, &ri->rk.rd);
if (!*printedprefix)
*printedprefix = 1;