summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_zebra.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-04-23 21:57:25 +0200
committerMark Stapp <mjs@voltanet.io>2018-04-23 22:06:39 +0200
commit4259ea81e9624b9ea878425b59b27cd0e4a867c4 (patch)
tree918613ae36e4b96d005feded6d3d7b4b488a9d67 /ospfd/ospf_zebra.c
parentMerge pull request #2103 from donaldsharp/bgp_zebra_youch (diff)
downloadfrr-4259ea81e9624b9ea878425b59b27cd0e4a867c4.tar.xz
frr-4259ea81e9624b9ea878425b59b27cd0e4a867c4.zip
ospfd: use prefix2str in debugs in zebra module
Clean up a typo or two, and use prefix2str consistently.
Diffstat (limited to 'ospfd/ospf_zebra.c')
-rw-r--r--ospfd/ospf_zebra.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index 648759670..141ece9c7 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -448,13 +448,13 @@ void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *p,
count++;
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
- char buf[2][INET_ADDRSTRLEN];
+ char buf[2][PREFIX2STR_BUFFER];
+
zlog_debug(
- "Zebra: Route add %s/%d nexthop %s, ifindex=%d",
- inet_ntop(AF_INET, &p->prefix, buf[0],
- sizeof(buf[0])),
- p->prefixlen, inet_ntop(AF_INET, &path->nexthop,
- buf[1], sizeof(buf[1])),
+ "Zebra: Route add %s nexthop %s, ifindex=%d",
+ prefix2str(p, buf[0], sizeof(buf[0])),
+ inet_ntop(AF_INET, &path->nexthop,
+ buf[1], sizeof(buf[1])),
path->ifindex);
}
}
@@ -476,10 +476,9 @@ void ospf_zebra_delete(struct ospf *ospf, struct prefix_ipv4 *p,
memcpy(&api.prefix, p, sizeof(*p));
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
- char buf[INET_ADDRSTRLEN];
- zlog_debug("Zebra: Route delete %s/%d",
- inet_ntop(AF_INET, &p->prefix, buf, sizeof(buf[0])),
- p->prefixlen);
+ char buf[PREFIX2STR_BUFFER];
+ zlog_debug("Zebra: Route delete %s",
+ prefix2str(p, buf, sizeof(buf)));
}
zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
@@ -499,9 +498,11 @@ void ospf_zebra_add_discard(struct ospf *ospf, struct prefix_ipv4 *p)
zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
- if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
- zlog_debug("Zebra: Route add discard %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
+ char buf[PREFIX2STR_BUFFER];
+ zlog_debug("Zebra: Route add discard %s",
+ prefix2str(p, buf, sizeof(buf)));
+ }
}
void ospf_zebra_delete_discard(struct ospf *ospf, struct prefix_ipv4 *p)
@@ -518,9 +519,11 @@ void ospf_zebra_delete_discard(struct ospf *ospf, struct prefix_ipv4 *p)
zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
- if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
- zlog_debug("Zebra: Route delete discard %s/%d",
- inet_ntoa(p->prefix), p->prefixlen);
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
+ char buf[PREFIX2STR_BUFFER];
+ zlog_debug("Zebra: Route delete discard %s",
+ prefix2str(p, buf, sizeof(buf)));
+ }
}
struct ospf_external *ospf_external_lookup(struct ospf *ospf, uint8_t type,
@@ -868,12 +871,13 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
if (DISTRIBUTE_LIST(ospf, type))
if (access_list_apply(DISTRIBUTE_LIST(ospf, type), p)
== FILTER_DENY) {
- if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
+ char buf[PREFIX2STR_BUFFER];
zlog_debug(
- "Redistribute[%s]: %s/%d filtered by ditribute-list.",
+ "Redistribute[%s]: %s filtered by distribute-list.",
ospf_redist_string(type),
- inet_ntoa(p->prefix),
- p->prefixlen);
+ prefix2str(p, buf, sizeof(buf)));
+ }
return 0;
}
@@ -890,11 +894,13 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
if (ret == RMAP_DENYMATCH) {
ei->route_map_set = save_values;
- if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE))
+ if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
+ char buf[PREFIX2STR_BUFFER];
zlog_debug(
- "Redistribute[%s]: %s/%d filtered by route-map.",
+ "Redistribute[%s]: %s filtered by route-map.",
ospf_redist_string(type),
- inet_ntoa(p->prefix), p->prefixlen);
+ prefix2str(p, buf, sizeof(buf)));
+ }
return 0;
}