diff options
author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-10-18 13:33:54 +0200 |
---|---|---|
committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-10-22 08:07:41 +0200 |
commit | 2dbe669bdf0f0bcbf0228ccdab7b631bd8b934f1 (patch) | |
tree | 69c38032b07630b46d2d5852200789b13392153c /ospf6d/ospf6_abr.c | |
parent | Merge pull request #7353 from AnuradhaKaruppiah/mh-cleanup-fix-1 (diff) | |
download | frr-2dbe669bdf0f0bcbf0228ccdab7b631bd8b934f1.tar.xz frr-2dbe669bdf0f0bcbf0228ccdab7b631bd8b934f1.zip |
:* Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ospf6d/ospf6_abr.c')
-rw-r--r-- | ospf6d/ospf6_abr.c | 101 |
1 files changed, 37 insertions, 64 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c index 6fe3a289c..cbb80b668 100644 --- a/ospf6d/ospf6_abr.c +++ b/ospf6d/ospf6_abr.c @@ -153,7 +153,6 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, struct ospf6_inter_router_lsa *router_lsa; struct ospf6_route_table *summary_table = NULL; uint16_t type; - char buf[PREFIX2STR_BUFFER]; int is_debug = 0; /* Only destination type network, range or ASBR are considered */ @@ -196,12 +195,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (route->type == OSPF6_DEST_TYPE_ROUTER) { if (ADV_ROUTER_IN_PREFIX(&route->prefix) == area->ospf6->router_id) { - inet_ntop(AF_INET, - &(ADV_ROUTER_IN_PREFIX(&route->prefix)), buf, - sizeof(buf)); zlog_debug( - "%s: Skipping ASBR announcement for ABR (%s)", - __func__, buf); + "%s: Skipping ASBR announcement for ABR (%pFX)", + __func__, + &ADV_ROUTER_IN_PREFIX(&route->prefix)); return 0; } } @@ -210,11 +207,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (IS_OSPF6_DEBUG_ABR || IS_OSPF6_DEBUG_ORIGINATE(INTER_ROUTER)) { is_debug++; - inet_ntop(AF_INET, - &(ADV_ROUTER_IN_PREFIX(&route->prefix)), buf, - sizeof(buf)); - zlog_debug("Originating summary in area %s for ASBR %s", - area->name, buf); + zlog_debug( + "Originating summary in area %s for ASBR %pFX", + area->name, + &ADV_ROUTER_IN_PREFIX(&route->prefix)); } summary_table = area->summary_router; } else { @@ -226,16 +222,13 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, route->path.origin.type == htons(OSPF6_LSTYPE_INTER_PREFIX)) { if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) { - if (is_debug) { - inet_ntop(AF_INET, - &(ADV_ROUTER_IN_PREFIX( - &route->prefix)), buf, - sizeof(buf)); + if (is_debug) zlog_debug( - "%s: route %s with cost %u is not best, ignore.", - __func__, buf, + "%s: route %pFX with cost %u is not best, ignore.", + __func__, + &ADV_ROUTER_IN_PREFIX( + &route->prefix), route->path.cost); - } return 0; } } @@ -243,23 +236,19 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (route->path.origin.type == htons(OSPF6_LSTYPE_INTRA_PREFIX)) { if (!CHECK_FLAG(route->flag, OSPF6_ROUTE_BEST)) { - if (is_debug) { - prefix2str(&route->prefix, buf, - sizeof(buf)); + if (is_debug) zlog_debug( - "%s: intra-prefix route %s with cost %u is not best, ignore.", - __func__, buf, + "%s: intra-prefix route %pFX with cost %u is not best, ignore.", + __func__, &route->prefix, route->path.cost); - } return 0; } } - if (is_debug) { - prefix2str(&route->prefix, buf, sizeof(buf)); - zlog_debug("Originating summary in area %s for %s cost %u", - area->name, buf, route->path.cost); - } + if (is_debug) + zlog_debug( + "Originating summary in area %s for %pFX cost %u", + area->name, &route->prefix, route->path.cost); summary_table = area->summary_prefix; } @@ -369,11 +358,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (range && !CHECK_FLAG(range->flag, OSPF6_ROUTE_REMOVE) && (route->path.area_id != OSPF_AREA_BACKBONE || !IS_AREA_TRANSIT(area))) { - if (is_debug) { - prefix2str(&range->prefix, buf, sizeof(buf)); - zlog_debug("Suppressed by range %s of area %s", - buf, route_area->name); - } + if (is_debug) + zlog_debug( + "Suppressed by range %pFX of area %s", + &range->prefix, route_area->name); ospf6_abr_delete_route(route, summary, summary_table, old); return 0; @@ -411,15 +399,11 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (EXPORT_LIST(area)) if (access_list_apply(EXPORT_LIST(area), &route->prefix) == FILTER_DENY) { - if (is_debug) { - inet_ntop(AF_INET, - &(ADV_ROUTER_IN_PREFIX( - &route->prefix)), - buf, sizeof(buf)); + if (is_debug) zlog_debug( - "prefix %s was denied by export list", - buf); - } + "prefix %pFX was denied by export list", + &ADV_ROUTER_IN_PREFIX( + &route->prefix)); return 0; } } @@ -428,15 +412,10 @@ int ospf6_abr_originate_summary_to_area(struct ospf6_route *route, if (PREFIX_LIST_OUT(area)) if (prefix_list_apply(PREFIX_LIST_OUT(area), &route->prefix) != PREFIX_PERMIT) { - if (is_debug) { - inet_ntop( - AF_INET, - &(ADV_ROUTER_IN_PREFIX(&route->prefix)), - buf, sizeof(buf)); + if (is_debug) zlog_debug( - "prefix %s was denied by filter-list out", - buf); - } + "prefix %pFX was denied by filter-list out", + &ADV_ROUTER_IN_PREFIX(&route->prefix)); return 0; } @@ -798,7 +777,6 @@ void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa, struct ospf6_path *o_path; struct ospf6_nexthop *nh, *rnh; bool nh_updated = false; - char buf[PREFIX2STR_BUFFER]; for (ALL_LIST_ELEMENTS(old->paths, anode, anext, o_path)) { if (o_path->origin.adv_router != lsa->header->adv_router @@ -820,16 +798,13 @@ void ospf6_abr_old_route_remove(struct ospf6_lsa *lsa, if (nh_updated) { if (listcount(old->paths)) { - if (IS_OSPF6_DEBUG_ABR || - IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX)) { - prefix2str(&old->prefix, buf, - sizeof(buf)); - zlog_debug("%s: old %s updated nh %u", - __func__, buf, + if (IS_OSPF6_DEBUG_ABR + || IS_OSPF6_DEBUG_EXAMIN(INTER_PREFIX)) + zlog_debug("%s: old %pFX updated nh %u", + __func__, &old->prefix, old->nh_list ? listcount( old->nh_list) : 0); - } if (table->hook_add) (*table->hook_add)(old); @@ -1140,13 +1115,11 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa) continue; if ((ospf6_route_cmp(route, old_route) != 0)) { - if (is_debug) { - prefix2str(&prefix, buf, sizeof(buf)); + if (is_debug) zlog_debug( - "%s: old %p %s cost %u new route cost %u are not same", - __func__, (void *)old_route, buf, + "%s: old %p %pFX cost %u new route cost %u are not same", + __func__, (void *)old_route, &prefix, old_route->path.cost, route->path.cost); - } /* Check new route's adv. router is same in one of * the paths with differed cost, if so remove the |