summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-10-14 13:17:14 -0400
committerDonald Sharp <sharpd@nvidia.com>2020-10-17 13:39:10 -0400
commitae32e1c29810a7aa163607da2ec9f7d00c977094 (patch)
treedd5a8fb35786ddcbcbbf095f4de9075dee4b41b2
parentf42238f8951f9d4e7092d4aec2df17ec0f303d7d (diff)
ospfd: Convert to using %pFX
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
-rw-r--r--ospfd/ospf_abr.c16
-rw-r--r--ospfd/ospf_asbr.c6
-rw-r--r--ospfd/ospf_ia.c11
-rw-r--r--ospfd/ospf_lsa.c21
-rw-r--r--ospfd/ospf_route.c8
-rw-r--r--ospfd/ospf_vty.c5
6 files changed, 28 insertions, 39 deletions
diff --git a/ospfd/ospf_abr.c b/ospfd/ospf_abr.c
index 2131c8ee9d..1375917cdb 100644
--- a/ospfd/ospf_abr.c
+++ b/ospfd/ospf_abr.c
@@ -868,16 +868,16 @@ static void ospf_abr_announce_network(struct ospf *ospf, struct prefix_ipv4 *p,
if (!ospf_abr_should_accept(p, area)) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_abr_announce_network(): prefix %s/%d was denied by import-list",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_abr_announce_network(): prefix %pFX was denied by import-list",
+ p);
continue;
}
if (!ospf_abr_plist_in_check(area, or, p)) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_abr_announce_network(): prefix %s/%d was denied by prefix-list",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_abr_announce_network(): prefix %pFX was denied by prefix-list",
+ p);
continue;
}
@@ -893,8 +893,8 @@ static void ospf_abr_announce_network(struct ospf *ospf, struct prefix_ipv4 *p,
if (or->path_type == OSPF_PATH_INTER_AREA) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_abr_announce_network(): this is inter-area route to %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_abr_announce_network(): this is inter-area route to %pFX",
+ p);
if (!OSPF_IS_AREA_BACKBONE(area))
ospf_abr_announce_network_to_area(p, or->cost,
@@ -904,8 +904,8 @@ static void ospf_abr_announce_network(struct ospf *ospf, struct prefix_ipv4 *p,
if (or->path_type == OSPF_PATH_INTRA_AREA) {
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_abr_announce_network(): this is intra-area route to %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_abr_announce_network(): this is intra-area route to %pFX",
+ p);
if ((range = ospf_area_range_match(or_area, p))
&& !ospf_area_is_transit(area))
ospf_abr_update_aggregate(range, or, area);
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index 8fb6402c7e..b64ec981be 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -53,8 +53,7 @@ void ospf_external_route_remove(struct ospf *ospf, struct prefix_ipv4 *p)
rn = route_node_lookup(ospf->old_external_route, (struct prefix *)p);
if (rn)
if ((or = rn->info)) {
- zlog_info("Route[%s/%d]: external path deleted",
- inet_ntoa(p->prefix), p->prefixlen);
+ zlog_info("Route[%pFX]: external path deleted", p);
/* Remove route from zebra. */
if (or->type == OSPF_DESTINATION_NETWORK)
@@ -69,8 +68,7 @@ void ospf_external_route_remove(struct ospf *ospf, struct prefix_ipv4 *p)
return;
}
- zlog_info("Route[%s/%d]: no such external path", inet_ntoa(p->prefix),
- p->prefixlen);
+ zlog_info("Route[%pFX]: no such external path", p);
}
/* Add an External info for AS-external-LSA. */
diff --git a/ospfd/ospf_ia.c b/ospfd/ospf_ia.c
index 87929e4369..7d6a19524a 100644
--- a/ospfd/ospf_ia.c
+++ b/ospfd/ospf_ia.c
@@ -76,8 +76,8 @@ static void ospf_ia_network_route(struct ospf *ospf, struct route_table *rt,
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_ia_network_route(): processing summary route to %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_ia_network_route(): processing summary route to %pFX",
+ p);
/* Find a route to the same dest */
if ((rn1 = route_node_lookup(rt, (struct prefix *)p))) {
@@ -113,8 +113,8 @@ static void ospf_ia_network_route(struct ospf *ospf, struct route_table *rt,
else { /* no route */
if (IS_DEBUG_OSPF_EVENT)
zlog_debug(
- "ospf_ia_network_route(): add new route to %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_ia_network_route(): add new route to %pFX",
+ p);
ospf_route_add(rt, p, new_or, abr_or);
}
}
@@ -129,8 +129,7 @@ static void ospf_ia_router_route(struct ospf *ospf, struct route_table *rtrs,
int ret;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_ia_router_route(): considering %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ zlog_debug("ospf_ia_router_route(): considering %pFX", p);
/* Find a route to the same dest */
rn = route_node_get(rtrs, (struct prefix *)p);
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 0200bf5e26..2f72642bce 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -2117,9 +2117,8 @@ void ospf_nssa_lsa_flush(struct ospf *ospf, struct prefix_ipv4 *p)
if (!lsa) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug(
- "LSA: There is no such AS-NSSA-LSA %s/%d in LSDB",
- inet_ntoa(p->prefix),
- p->prefixlen);
+ "LSA: There is no such AS-NSSA-LSA %pFX in LSDB",
+ p);
continue;
}
ospf_ls_retransmit_delete_nbr_area(area, lsa);
@@ -2139,15 +2138,14 @@ void ospf_external_lsa_flush(struct ospf *ospf, uint8_t type,
struct ospf_lsa *lsa;
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
- zlog_debug("LSA: Flushing AS-external-LSA %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ zlog_debug("LSA: Flushing AS-external-LSA %pFX", p);
/* First lookup LSA from LSDB. */
if (!(lsa = ospf_external_info_find_lsa(ospf, p))) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug(
- "LSA: There is no such AS-external-LSA %s/%d in LSDB",
- inet_ntoa(p->prefix), p->prefixlen);
+ "LSA: There is no such AS-external-LSA %pFX in LSDB",
+ p);
return;
}
@@ -3363,8 +3361,8 @@ struct in_addr ospf_lsa_unique_id(struct ospf *ospf, struct ospf_lsdb *lsdb,
if (ip_masklen(al->mask) == p->prefixlen) {
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
zlog_debug(
- "ospf_lsa_unique_id(): Can't get Link State ID for %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ "ospf_lsa_unique_id(): Can't get Link State ID for %pFX",
+ p);
/* id.s_addr = 0; */
id.s_addr = 0xffffffff;
return id;
@@ -3380,9 +3378,8 @@ struct in_addr ospf_lsa_unique_id(struct ospf *ospf, struct ospf_lsdb *lsdb,
if (lsa) {
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
zlog_debug(
- "ospf_lsa_unique_id(): Can't get Link State ID for %s/%d",
- inet_ntoa(p->prefix),
- p->prefixlen);
+ "ospf_lsa_unique_id(): Can't get Link State ID for %pFX",
+ p);
/* id.s_addr = 0; */
id.s_addr = 0xffffffff;
return id;
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index 3b049555ba..e3e6f68a82 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -989,9 +989,7 @@ int ospf_add_discard_route(struct ospf *ospf, struct route_table *rt,
}
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug(
- "ospf_add_discard_route(): adding %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ zlog_debug("ospf_add_discard_route(): adding %pFX", p);
new_or = ospf_route_new();
new_or->type = OSPF_DESTINATION_DISCARD;
@@ -1014,9 +1012,7 @@ void ospf_delete_discard_route(struct ospf *ospf, struct route_table *rt,
struct ospf_route * or ;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug(
- "ospf_delete_discard_route(): deleting %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ zlog_debug("ospf_delete_discard_route(): deleting %pFX", p);
rn = route_node_lookup(rt, (struct prefix *)p);
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 5c82e11393..870c9dd0a8 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3465,9 +3465,8 @@ static void show_ip_ospf_interface_sub(struct vty *vty, struct ospf *ospf,
"ipAddressPrefixlen",
oi->address->prefixlen);
} else
- vty_out(vty, " Internet Address %s/%d,",
- inet_ntoa(oi->address->u.prefix4),
- oi->address->prefixlen);
+ vty_out(vty, " Internet Address %pFX,",
+ oi->address);
/* For Vlinks, showing the peer address is
* probably more informative than the local