diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-10-21 13:56:26 -0400 |
|---|---|---|
| committer | Mark Stapp <mjs@voltanet.io> | 2020-10-22 13:37:25 -0400 |
| commit | 96b663a381c2e90fa663d69fce4e40f0be698e58 (patch) | |
| tree | 061e8297387581dcb5e730f405bf9a5596a58dc1 /ospfd/ospf_flood.c | |
| parent | 84de5a245a3eb17619588a535b9f408ce802a8c9 (diff) | |
ospfd: replace inet_ntoa
Stop using inet_ntoa, use %pI4 etc or inet_ntop instead
Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ospfd/ospf_flood.c')
| -rw-r--r-- | ospfd/ospf_flood.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 7d461d4587..0f43553c01 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -157,9 +157,9 @@ static void ospf_process_self_originated_lsa(struct ospf *ospf, if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "%s:LSA[Type%d:%s]: Process self-originated LSA seq 0x%x", + "%s:LSA[Type%d:%pI4]: Process self-originated LSA seq 0x%x", ospf_get_name(ospf), new->data->type, - inet_ntoa(new->data->id), ntohl(new->data->ls_seqnum)); + &new->data->id, ntohl(new->data->ls_seqnum)); /* If we're here, we installed a self-originated LSA that we received from a neighbor, i.e. it's more recent. We must see whether we want @@ -276,8 +276,8 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "%s:LSA[Flooding]: start, NBR %s (%s), cur(%p), New-LSA[%s]", - ospf_get_name(ospf), inet_ntoa(nbr->router_id), + "%s:LSA[Flooding]: start, NBR %pI4 (%s), cur(%p), New-LSA[%s]", + ospf_get_name(ospf), &nbr->router_id, lookup_msg(ospf_nsm_state_msg, nbr->state, NULL), (void *)current, dump_lsa_key(new)); @@ -345,9 +345,9 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, /* Handling Max age grace LSA.*/ if (IS_DEBUG_OSPF_GR_HELPER) zlog_debug( - "%s, Received a maxage GRACE-LSA from router %s", + "%s, Received a maxage GRACE-LSA from router %pI4", __PRETTY_FUNCTION__, - inet_ntoa(new->data->adv_router)); + &new->data->adv_router); if (current) { ospf_process_maxage_grace_lsa(ospf, new, nbr); @@ -361,9 +361,9 @@ int ospf_flood(struct ospf *ospf, struct ospf_neighbor *nbr, } else { if (IS_DEBUG_OSPF_GR_HELPER) zlog_debug( - "%s, Received a GRACE-LSA from router %s", + "%s, Received a GRACE-LSA from router %pI4", __PRETTY_FUNCTION__, - inet_ntoa(new->data->adv_router)); + &new->data->adv_router); if (ospf_process_grace_lsa(ospf, new, nbr) == OSPF_GR_NOT_HELPER) { @@ -412,11 +412,15 @@ static int ospf_flood_through_interface(struct ospf_interface *oi, struct ospf_neighbor *onbr; struct route_node *rn; int retx_flag; + char buf[PREFIX_STRLEN]; if (IS_DEBUG_OSPF_EVENT) zlog_debug( "%s:ospf_flood_through_interface(): considering int %s, INBR(%s), LSA[%s] AGE %u", - ospf_get_name(oi->ospf), IF_NAME(oi), inbr ? inet_ntoa(inbr->router_id) : "NULL", + ospf_get_name(oi->ospf), IF_NAME(oi), + inbr ? + inet_ntop(AF_INET, &inbr->router_id, buf, sizeof(buf)) : + "NULL", dump_lsa_key(lsa), ntohs(lsa->data->ls_age)); if (!ospf_if_is_enable(oi)) @@ -437,8 +441,8 @@ static int ospf_flood_through_interface(struct ospf_interface *oi, onbr = rn->info; if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_flood_through_interface(): considering nbr %s(%s) (%s)", - inet_ntoa(onbr->router_id), + "ospf_flood_through_interface(): considering nbr %pI4(%s) (%s)", + &onbr->router_id, ospf_get_name(oi->ospf), lookup_msg(ospf_nsm_state_msg, onbr->state, NULL)); @@ -773,9 +777,9 @@ void ospf_ls_request_add(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) * the common function "ospf_lsdb_add()" -- endo. */ if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) - zlog_debug("RqstL(%lu)++, NBR(%s(%s)), LSA[%s]", + zlog_debug("RqstL(%lu)++, NBR(%pI4(%s)), LSA[%s]", ospf_ls_request_count(nbr), - inet_ntoa(nbr->router_id), + &nbr->router_id, ospf_get_name(nbr->oi->ospf), dump_lsa_key(lsa)); ospf_lsdb_add(&nbr->ls_req, lsa); @@ -800,9 +804,9 @@ void ospf_ls_request_delete(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) } if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) /* -- endo. */ - zlog_debug("RqstL(%lu)--, NBR(%s(%s)), LSA[%s]", + zlog_debug("RqstL(%lu)--, NBR(%pI4(%s)), LSA[%s]", ospf_ls_request_count(nbr), - inet_ntoa(nbr->router_id), + &nbr->router_id, ospf_get_name(nbr->oi->ospf), dump_lsa_key(lsa)); ospf_lsdb_delete(&nbr->ls_req, lsa); @@ -862,9 +866,9 @@ void ospf_ls_retransmit_add(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) if (old) { old->retransmit_counter--; if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) - zlog_debug("RXmtL(%lu)--, NBR(%s(%s)), LSA[%s]", + zlog_debug("RXmtL(%lu)--, NBR(%pI4(%s)), LSA[%s]", ospf_ls_retransmit_count(nbr), - inet_ntoa(nbr->router_id), + &nbr->router_id, ospf_get_name(nbr->oi->ospf), dump_lsa_key(old)); ospf_lsdb_delete(&nbr->ls_rxmt, old); @@ -879,9 +883,9 @@ void ospf_ls_retransmit_add(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) * the common function "ospf_lsdb_add()" -- endo. */ if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) - zlog_debug("RXmtL(%lu)++, NBR(%s(%s)), LSA[%s]", + zlog_debug("RXmtL(%lu)++, NBR(%pI4(%s)), LSA[%s]", ospf_ls_retransmit_count(nbr), - inet_ntoa(nbr->router_id), + &nbr->router_id, ospf_get_name(nbr->oi->ospf), dump_lsa_key(lsa)); ospf_lsdb_add(&nbr->ls_rxmt, lsa); @@ -894,9 +898,9 @@ void ospf_ls_retransmit_delete(struct ospf_neighbor *nbr, struct ospf_lsa *lsa) if (ospf_ls_retransmit_lookup(nbr, lsa)) { lsa->retransmit_counter--; if (IS_DEBUG_OSPF(lsa, LSA_FLOODING)) /* -- endo. */ - zlog_debug("RXmtL(%lu)--, NBR(%s(%s)), LSA[%s]", + zlog_debug("RXmtL(%lu)--, NBR(%pI4(%s)), LSA[%s]", ospf_ls_retransmit_count(nbr), - inet_ntoa(nbr->router_id), + &nbr->router_id, ospf_get_name(nbr->oi->ospf), dump_lsa_key(lsa)); ospf_lsdb_delete(&nbr->ls_rxmt, lsa); @@ -984,8 +988,8 @@ void ospf_lsa_flush_area(struct ospf_lsa *lsa, struct ospf_area *area) retransmissions */ lsa->data->ls_age = htons(OSPF_LSA_MAXAGE); if (IS_DEBUG_OSPF_EVENT) - zlog_debug("%s: MAXAGE set to LSA %s", __func__, - inet_ntoa(lsa->data->id)); + zlog_debug("%s: MAXAGE set to LSA %pI4", __func__, + &lsa->data->id); monotime(&lsa->tv_recv); lsa->tv_orig = lsa->tv_recv; ospf_flood_through_area(area, NULL, lsa); |
