summaryrefslogtreecommitdiffstats
path: root/pimd/pim_rp.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-10-22 16:01:20 +0200
committerMark Stapp <mjs@voltanet.io>2020-10-22 16:13:56 +0200
commitee2bbf7ce20616e09f45b8b2f13e6fcba921c57d (patch)
tree7895f00a1be28c63c30377264abde11f7a8f8c4d /pimd/pim_rp.c
parentMerge pull request #7343 from ton31337/fix/prefix2str_to_pFX (diff)
downloadfrr-ee2bbf7ce20616e09f45b8b2f13e6fcba921c57d.tar.xz
frr-ee2bbf7ce20616e09f45b8b2f13e6fcba921c57d.zip
pimd: replace inet_ntoa
Replace all use of inet_ntoa, using %pI4 or inet_ntoa instead Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'pimd/pim_rp.c')
-rw-r--r--pimd/pim_rp.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c
index 0ec8e45ed..7246482f0 100644
--- a/pimd/pim_rp.c
+++ b/pimd/pim_rp.c
@@ -350,8 +350,8 @@ void pim_upstream_update(struct pim_instance *pim, struct pim_upstream *up)
up->sg.grp);
if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: pim upstream update for old upstream %s",
- __func__, inet_ntoa(old_upstream_addr));
+ zlog_debug("%s: pim upstream update for old upstream %pI4",
+ __func__, &old_upstream_addr);
if (old_upstream_addr.s_addr == new_upstream_addr.s_addr)
return;
@@ -1204,6 +1204,7 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
struct rp_info *prev_rp_info = NULL;
struct listnode *node;
char source[7];
+ char buf[PREFIX_STRLEN];
json_object *json = NULL;
json_object *json_rp_rows = NULL;
@@ -1236,9 +1237,11 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
.s_addr) {
json_object_object_add(
json,
- inet_ntoa(prev_rp_info->rp
+ inet_ntop(AF_INET,
+ &prev_rp_info->rp
.rpf_addr.u
- .prefix4),
+ .prefix4,
+ buf, sizeof(buf)),
json_rp_rows);
json_rp_rows = NULL;
}
@@ -1249,8 +1252,10 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
json_row = json_object_new_object();
json_object_string_add(
json_row, "rpAddress",
- inet_ntoa(rp_info->rp.rpf_addr.u
- .prefix4));
+ inet_ntop(AF_INET,
+ &rp_info->rp.rpf_addr.u
+ .prefix4,
+ buf, sizeof(buf)));
if (rp_info->rp.source_nexthop.interface)
json_object_string_add(
json_row, "outboundInterface",
@@ -1282,8 +1287,10 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
json_object_array_add(json_rp_rows, json_row);
} else {
vty_out(vty, "%-15s ",
- inet_ntoa(rp_info->rp.rpf_addr.u
- .prefix4));
+ inet_ntop(AF_INET,
+ &rp_info->rp.rpf_addr.u
+ .prefix4,
+ buf, sizeof(buf)));
if (rp_info->plist)
vty_out(vty, "%-18s ", rp_info->plist);
@@ -1313,7 +1320,9 @@ void pim_rp_show_information(struct pim_instance *pim, struct vty *vty, bool uj)
if (prev_rp_info && json_rp_rows)
json_object_object_add(
json,
- inet_ntoa(prev_rp_info->rp.rpf_addr.u.prefix4),
+ inet_ntop(AF_INET,
+ &prev_rp_info->rp.rpf_addr.u.prefix4,
+ buf, sizeof(buf)),
json_rp_rows);
vty_out(vty, "%s\n", json_object_to_json_string_ext(