X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ospfd%2Fospf_ia.c;h=f805899b81a07e1eb8e42fdbc314e0bcb253c7c4;hb=96b663a381c2e90fa663d69fce4e40f0be698e58;hp=86d15480a369c4b6f118e32290a2e4aea92ddd5a;hpb=615e608d76bd3e1acf1769c914142210ac88e3f7;p=mirror_frr.git diff --git a/ospfd/ospf_ia.c b/ospfd/ospf_ia.c index 86d15480a..f805899b8 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))) { @@ -88,8 +88,7 @@ static void ospf_ia_network_route(struct ospf *ospf, struct route_table *rt, if ((or = rn1->info)) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_ia_network_route(): " - "Found a route to the same network"); + "ospf_ia_network_route(): Found a route to the same network"); /* Check the existing route. */ if ((res = ospf_route_cmp(ospf, new_or, or)) < 0) { /* New route is better, so replace old one. */ @@ -114,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); } } @@ -130,8 +129,8 @@ 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); @@ -151,8 +150,7 @@ static void ospf_ia_router_route(struct ospf *ospf, struct route_table *rtrs, if (or) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_ia_router_route(): " - "a route to the same ABR through the same area exists"); + "ospf_ia_router_route(): a route to the same ABR through the same area exists"); /* New route is better */ if ((ret = ospf_route_cmp(ospf, new_or, or)) < 0) { listnode_delete(rn->info, or); @@ -204,8 +202,8 @@ static int process_summary_lsa(struct ospf_area *area, struct route_table *rt, sl = (struct summary_lsa *)lsa->data; if (IS_DEBUG_OSPF_EVENT) - zlog_debug("process_summary_lsa(): LS ID: %s", - inet_ntoa(sl->header.id)); + zlog_debug("process_summary_lsa(): LS ID: %pI4", + &sl->header.id); metric = GET_METRIC(sl->metric); @@ -329,8 +327,7 @@ static void ospf_update_network_route(struct ospf *ospf, struct route_table *rt, backbone paths */ if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_update_network_route(): " - "Allowing Shortcut ABR to add new route"); + "ospf_update_network_route(): Allowing Shortcut ABR to add new route"); new_or = ospf_route_new(); new_or->type = OSPF_DESTINATION_NETWORK; new_or->id = lsa->header.id; @@ -367,8 +364,7 @@ static void ospf_update_network_route(struct ospf *ospf, struct route_table *rt, or->u.std.area_id)) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_update_network_route(): Shortcut: " - "this intra-area path is not backbone"); + "ospf_update_network_route(): Shortcut: this intra-area path is not backbone"); return; } } else /* Not Shortcut ABR */ @@ -376,8 +372,7 @@ static void ospf_update_network_route(struct ospf *ospf, struct route_table *rt, if (!OSPF_IS_AREA_ID_BACKBONE(or->u.std.area_id)) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_update_network_route(): " - "route is not BB-associated"); + "ospf_update_network_route(): route is not BB-associated"); return; /* We can update only BB routes */ } } @@ -392,16 +387,14 @@ static void ospf_update_network_route(struct ospf *ospf, struct route_table *rt, if (or->cost == cost) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_update_network_route(): " - "new route is same distance, adding nexthops"); + "ospf_update_network_route(): new route is same distance, adding nexthops"); ospf_route_copy_nexthops(or, abr_or->paths); } if (or->cost > cost) { if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_update_network_route(): " - "new route is better, overriding nexthops"); + "ospf_update_network_route(): new route is better, overriding nexthops"); ospf_route_subst_nexthops(or, abr_or->paths); or->cost = cost; @@ -531,8 +524,8 @@ static int process_transit_summary_lsa(struct ospf_area *area, sl = (struct summary_lsa *)lsa->data; if (IS_DEBUG_OSPF_EVENT) - zlog_debug("process_transit_summaries(): LS ID: %s", - inet_ntoa(lsa->data->id)); + zlog_debug("process_transit_summaries(): LS ID: %pI4", + &lsa->data->id); metric = GET_METRIC(sl->metric); if (metric == OSPF_LS_INFINITY) { @@ -589,23 +582,19 @@ static void ospf_examine_transit_summaries(struct ospf_area *area, void ospf_ia_routing(struct ospf *ospf, struct route_table *rt, struct route_table *rtrs) { + struct listnode *node; struct ospf_area *area; if (IS_DEBUG_OSPF_EVENT) zlog_debug("ospf_ia_routing():start"); if (IS_OSPF_ABR(ospf)) { - struct listnode *node; - struct ospf_area *area; - switch (ospf->abr_type) { case OSPF_ABR_STAND: if (IS_DEBUG_OSPF_EVENT) zlog_debug("ospf_ia_routing():Standard ABR"); if ((area = ospf->backbone)) { - struct listnode *node; - if (IS_DEBUG_OSPF_EVENT) { zlog_debug( "ospf_ia_routing():backbone area found"); @@ -653,8 +642,7 @@ void ospf_ia_routing(struct ospf *ospf, struct route_table *rt, */ if (IS_DEBUG_OSPF_EVENT) zlog_debug( - "ospf_ia_routing(): " - "Active BB connection not found"); + "ospf_ia_routing(): Active BB connection not found"); for (ALL_LIST_ELEMENTS_RO(ospf->areas, node, area)) OSPF_EXAMINE_SUMMARIES_ALL(area, rt, @@ -694,8 +682,6 @@ void ospf_ia_routing(struct ospf *ospf, struct route_table *rt, break; } } else { - struct listnode *node; - if (IS_DEBUG_OSPF_EVENT) zlog_debug( "ospf_ia_routing():not ABR, considering all areas");