ospfd: Convert to using %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
Donald Sharp 2020-10-14 13:17:14 -04:00
parent f42238f895
commit ae32e1c298
6 changed files with 28 additions and 39 deletions

View File

@ -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);

View File

@ -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. */

View File

@ -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);

View File

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

View File

@ -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);

View File

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