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 (!ospf_abr_should_accept(p, area)) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_abr_announce_network(): prefix %s/%d was denied by import-list", "ospf_abr_announce_network(): prefix %pFX was denied by import-list",
inet_ntoa(p->prefix), p->prefixlen); p);
continue; continue;
} }
if (!ospf_abr_plist_in_check(area, or, p)) { if (!ospf_abr_plist_in_check(area, or, p)) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_abr_announce_network(): prefix %s/%d was denied by prefix-list", "ospf_abr_announce_network(): prefix %pFX was denied by prefix-list",
inet_ntoa(p->prefix), p->prefixlen); p);
continue; 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 (or->path_type == OSPF_PATH_INTER_AREA) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_abr_announce_network(): this is inter-area route to %s/%d", "ospf_abr_announce_network(): this is inter-area route to %pFX",
inet_ntoa(p->prefix), p->prefixlen); p);
if (!OSPF_IS_AREA_BACKBONE(area)) if (!OSPF_IS_AREA_BACKBONE(area))
ospf_abr_announce_network_to_area(p, or->cost, 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 (or->path_type == OSPF_PATH_INTRA_AREA) {
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_abr_announce_network(): this is intra-area route to %s/%d", "ospf_abr_announce_network(): this is intra-area route to %pFX",
inet_ntoa(p->prefix), p->prefixlen); p);
if ((range = ospf_area_range_match(or_area, p)) if ((range = ospf_area_range_match(or_area, p))
&& !ospf_area_is_transit(area)) && !ospf_area_is_transit(area))
ospf_abr_update_aggregate(range, or, 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); rn = route_node_lookup(ospf->old_external_route, (struct prefix *)p);
if (rn) if (rn)
if ((or = rn->info)) { if ((or = rn->info)) {
zlog_info("Route[%s/%d]: external path deleted", zlog_info("Route[%pFX]: external path deleted", p);
inet_ntoa(p->prefix), p->prefixlen);
/* Remove route from zebra. */ /* Remove route from zebra. */
if (or->type == OSPF_DESTINATION_NETWORK) if (or->type == OSPF_DESTINATION_NETWORK)
@ -69,8 +68,7 @@ void ospf_external_route_remove(struct ospf *ospf, struct prefix_ipv4 *p)
return; return;
} }
zlog_info("Route[%s/%d]: no such external path", inet_ntoa(p->prefix), zlog_info("Route[%pFX]: no such external path", p);
p->prefixlen);
} }
/* Add an External info for AS-external-LSA. */ /* 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) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_ia_network_route(): processing summary route to %s/%d", "ospf_ia_network_route(): processing summary route to %pFX",
inet_ntoa(p->prefix), p->prefixlen); p);
/* Find a route to the same dest */ /* Find a route to the same dest */
if ((rn1 = route_node_lookup(rt, (struct prefix *)p))) { 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 */ else { /* no route */
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug(
"ospf_ia_network_route(): add new route to %s/%d", "ospf_ia_network_route(): add new route to %pFX",
inet_ntoa(p->prefix), p->prefixlen); p);
ospf_route_add(rt, p, new_or, abr_or); 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; int ret;
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug("ospf_ia_router_route(): considering %s/%d", zlog_debug("ospf_ia_router_route(): considering %pFX", p);
inet_ntoa(p->prefix), p->prefixlen);
/* Find a route to the same dest */ /* Find a route to the same dest */
rn = route_node_get(rtrs, (struct prefix *)p); 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 (!lsa) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug( zlog_debug(
"LSA: There is no such AS-NSSA-LSA %s/%d in LSDB", "LSA: There is no such AS-NSSA-LSA %pFX in LSDB",
inet_ntoa(p->prefix), p);
p->prefixlen);
continue; continue;
} }
ospf_ls_retransmit_delete_nbr_area(area, lsa); 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; struct ospf_lsa *lsa;
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug("LSA: Flushing AS-external-LSA %s/%d", zlog_debug("LSA: Flushing AS-external-LSA %pFX", p);
inet_ntoa(p->prefix), p->prefixlen);
/* First lookup LSA from LSDB. */ /* First lookup LSA from LSDB. */
if (!(lsa = ospf_external_info_find_lsa(ospf, p))) { if (!(lsa = ospf_external_info_find_lsa(ospf, p))) {
if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) if (IS_DEBUG_OSPF(lsa, LSA_FLOODING))
zlog_debug( zlog_debug(
"LSA: There is no such AS-external-LSA %s/%d in LSDB", "LSA: There is no such AS-external-LSA %pFX in LSDB",
inet_ntoa(p->prefix), p->prefixlen); p);
return; 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 (ip_masklen(al->mask) == p->prefixlen) {
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
zlog_debug( zlog_debug(
"ospf_lsa_unique_id(): Can't get Link State ID for %s/%d", "ospf_lsa_unique_id(): Can't get Link State ID for %pFX",
inet_ntoa(p->prefix), p->prefixlen); p);
/* id.s_addr = 0; */ /* id.s_addr = 0; */
id.s_addr = 0xffffffff; id.s_addr = 0xffffffff;
return id; return id;
@ -3380,9 +3378,8 @@ struct in_addr ospf_lsa_unique_id(struct ospf *ospf, struct ospf_lsdb *lsdb,
if (lsa) { if (lsa) {
if (IS_DEBUG_OSPF(lsa, LSA_GENERATE)) if (IS_DEBUG_OSPF(lsa, LSA_GENERATE))
zlog_debug( zlog_debug(
"ospf_lsa_unique_id(): Can't get Link State ID for %s/%d", "ospf_lsa_unique_id(): Can't get Link State ID for %pFX",
inet_ntoa(p->prefix), p);
p->prefixlen);
/* id.s_addr = 0; */ /* id.s_addr = 0; */
id.s_addr = 0xffffffff; id.s_addr = 0xffffffff;
return id; 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) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug("ospf_add_discard_route(): adding %pFX", p);
"ospf_add_discard_route(): adding %s/%d",
inet_ntoa(p->prefix), p->prefixlen);
new_or = ospf_route_new(); new_or = ospf_route_new();
new_or->type = OSPF_DESTINATION_DISCARD; 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 ; struct ospf_route * or ;
if (IS_DEBUG_OSPF_EVENT) if (IS_DEBUG_OSPF_EVENT)
zlog_debug( zlog_debug("ospf_delete_discard_route(): deleting %pFX", p);
"ospf_delete_discard_route(): deleting %s/%d",
inet_ntoa(p->prefix), p->prefixlen);
rn = route_node_lookup(rt, (struct prefix *)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", "ipAddressPrefixlen",
oi->address->prefixlen); oi->address->prefixlen);
} else } else
vty_out(vty, " Internet Address %s/%d,", vty_out(vty, " Internet Address %pFX,",
inet_ntoa(oi->address->u.prefix4), oi->address);
oi->address->prefixlen);
/* For Vlinks, showing the peer address is /* For Vlinks, showing the peer address is
* probably more informative than the local * probably more informative than the local