]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: Convert to using %pFX
authorDonald Sharp <sharpd@nvidia.com>
Wed, 14 Oct 2020 17:17:14 +0000 (13:17 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Sat, 17 Oct 2020 17:39:10 +0000 (13:39 -0400)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_abr.c
ospfd/ospf_asbr.c
ospfd/ospf_ia.c
ospfd/ospf_lsa.c
ospfd/ospf_route.c
ospfd/ospf_vty.c

index 2131c8ee9df3f4eee6b270cd73a5ce624eb4fac1..1375917cdbc7f7b4ae07ce899ad41fb20340c0ff 100644 (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);
index 8fb6402c7e9522c449531c4d305b74ae08f20be1..b64ec981bec016482560096a6f09b6968ff9fda4 100644 (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. */
index 87929e43698d7907444c04a1c516e09b2afa3151..7d6a19524abe35d9b30aaeda29d87b3e0d089891 100644 (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);
 
index 0200bf5e260384de9fee4a5dd6da0fb0489f488e..2f72642bce5683bba2e1f77fbf9f5e029ceb378d 100644 (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;
index 3b049555ba991e726d5c79cda8546f8349ef241c..e3e6f68a8230cfc82a4949a379ad07a36750b57b 100644 (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);
 
index 5c82e11393c972cc538d7a5aabbcf80fd81095c6..870c9dd0a884a153b3d22bef99ddf95b59fe3d20 100644 (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