summaryrefslogtreecommitdiff
path: root/ospfd/ospf_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd/ospf_route.c')
-rw-r--r--ospfd/ospf_route.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/ospfd/ospf_route.c b/ospfd/ospf_route.c
index e3e6f68a82..bcf563a5ba 100644
--- a/ospfd/ospf_route.c
+++ b/ospfd/ospf_route.c
@@ -307,8 +307,8 @@ void ospf_intra_add_router(struct route_table *rt, struct vertex *v,
lsa = (struct router_lsa *)v->lsa;
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_intra_add_router: LS ID: %s",
- inet_ntoa(lsa->header.id));
+ zlog_debug("ospf_intra_add_router: LS ID: %pI4",
+ &lsa->header.id);
if (!OSPF_IS_AREA_BACKBONE(area))
ospf_vl_up_check(area, lsa->header.id, v);
@@ -364,8 +364,7 @@ void ospf_intra_add_router(struct route_table *rt, struct vertex *v,
apply_mask_ipv4(&p);
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_intra_add_router: talking about %s/%d",
- inet_ntoa(p.prefix), p.prefixlen);
+ zlog_debug("ospf_intra_add_router: talking about %pFX", &p);
rn = route_node_get(rt, (struct prefix *)&p);
@@ -467,8 +466,8 @@ void ospf_intra_add_stub(struct route_table *rt, struct router_lsa_link *link,
apply_mask_ipv4(&p);
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("ospf_intra_add_stub(): processing route to %s/%d",
- inet_ntoa(p.prefix), p.prefixlen);
+ zlog_debug("ospf_intra_add_stub(): processing route to %pFX",
+ &p);
/* (1) Calculate the distance D of stub network from the root. D is
equal to the distance from the root to the router vertex
@@ -488,8 +487,8 @@ void ospf_intra_add_stub(struct route_table *rt, struct router_lsa_link *link,
if (parent_is_root && link->link_data.s_addr == 0xffffffff
&& ospf_if_lookup_by_local_addr(area->ospf, NULL, link->link_id)) {
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("%s: ignoring host route %s/32 to self.",
- __func__, inet_ntoa(link->link_id));
+ zlog_debug("%s: ignoring host route %pI4/32 to self.",
+ __func__, &link->link_id);
return;
}
@@ -653,8 +652,8 @@ void ospf_route_table_dump(struct route_table *rt)
or->cost);
for (ALL_LIST_ELEMENTS_RO(or->paths, pnode,
path))
- zlog_debug(" -> %s",
- inet_ntoa(path->nexthop));
+ zlog_debug(" -> %pI4",
+ &path->nexthop);
} else
zlog_debug("R %-18pI4 %-15pI4 %s %d",
&rn->p.u.prefix4,
@@ -682,11 +681,12 @@ void ospf_route_table_print(struct vty *vty, struct route_table *rt)
or->cost);
for (ALL_LIST_ELEMENTS_RO(or->paths, pnode,
path))
- vty_out(vty, " -> %s\n",
- path->nexthop.s_addr != 0
- ? inet_ntoa(
- path->nexthop)
- : "directly connected");
+ if (path->nexthop.s_addr != 0)
+ vty_out(vty, " -> %pI4\n",
+ &path->nexthop);
+ else
+ vty_out(vty, " -> %s\n",
+ "directly connected");
} else
vty_out(vty, "R %-18pI4 %-15pI4 %s %d\n",
&rn->p.u.prefix4, & or->u.std.area_id,
@@ -896,9 +896,8 @@ void ospf_prune_unreachable_networks(struct route_table *rt)
or = rn->info;
if (listcount(or->paths) == 0) {
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("Pruning route to %s/%d",
- inet_ntoa(rn->p.u.prefix4),
- rn->p.prefixlen);
+ zlog_debug("Pruning route to %pFX",
+ &rn->p);
ospf_route_free(or);
rn->info = NULL;
@@ -926,11 +925,11 @@ void ospf_prune_unreachable_routers(struct route_table *rtrs)
for (ALL_LIST_ELEMENTS(paths, node, nnode, or)) {
if (listcount(or->paths) == 0) {
if (IS_DEBUG_OSPF_EVENT) {
- zlog_debug("Pruning route to rtr %s",
- inet_ntoa(rn->p.u.prefix4));
+ zlog_debug("Pruning route to rtr %pI4",
+ &rn->p.u.prefix4);
zlog_debug(
- " via area %s",
- inet_ntoa(or->u.std.area_id));
+ " via area %pI4",
+ &or->u.std.area_id);
}
listnode_delete(paths, or);
@@ -940,8 +939,8 @@ void ospf_prune_unreachable_routers(struct route_table *rtrs)
if (listcount(paths) == 0) {
if (IS_DEBUG_OSPF_EVENT)
- zlog_debug("Pruning router node %s",
- inet_ntoa(rn->p.u.prefix4));
+ zlog_debug("Pruning router node %pI4",
+ &rn->p.u.prefix4);
list_delete(&paths);
rn->info = NULL;