Merge pull request #2112 from mjstapp/ospf_debug

ospfd: use prefix2str more consistently in zebra module debugs
This commit is contained in:
Russ White 2018-04-24 09:03:33 -04:00 committed by GitHub
commit f0cd2e8d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -448,13 +448,13 @@ void ospf_zebra_add(struct ospf *ospf, struct prefix_ipv4 *p,
count++; count++;
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) { if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
char buf[2][INET_ADDRSTRLEN]; char buf[2][PREFIX2STR_BUFFER];
zlog_debug( zlog_debug(
"Zebra: Route add %s/%d nexthop %s, ifindex=%d", "Zebra: Route add %s nexthop %s, ifindex=%d",
inet_ntop(AF_INET, &p->prefix, buf[0], prefix2str(p, buf[0], sizeof(buf[0])),
sizeof(buf[0])), inet_ntop(AF_INET, &path->nexthop,
p->prefixlen, inet_ntop(AF_INET, &path->nexthop, buf[1], sizeof(buf[1])),
buf[1], sizeof(buf[1])),
path->ifindex); path->ifindex);
} }
} }
@ -476,10 +476,9 @@ void ospf_zebra_delete(struct ospf *ospf, struct prefix_ipv4 *p,
memcpy(&api.prefix, p, sizeof(*p)); memcpy(&api.prefix, p, sizeof(*p));
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) { if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
char buf[INET_ADDRSTRLEN]; char buf[PREFIX2STR_BUFFER];
zlog_debug("Zebra: Route delete %s/%d", zlog_debug("Zebra: Route delete %s",
inet_ntop(AF_INET, &p->prefix, buf, sizeof(buf[0])), prefix2str(p, buf, sizeof(buf)));
p->prefixlen);
} }
zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api); 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); zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api);
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
zlog_debug("Zebra: Route add discard %s/%d", char buf[PREFIX2STR_BUFFER];
inet_ntoa(p->prefix), p->prefixlen); zlog_debug("Zebra: Route add discard %s",
prefix2str(p, buf, sizeof(buf)));
}
} }
void ospf_zebra_delete_discard(struct ospf *ospf, struct prefix_ipv4 *p) 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); zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
zlog_debug("Zebra: Route delete discard %s/%d", char buf[PREFIX2STR_BUFFER];
inet_ntoa(p->prefix), p->prefixlen); zlog_debug("Zebra: Route delete discard %s",
prefix2str(p, buf, sizeof(buf)));
}
} }
struct ospf_external *ospf_external_lookup(struct ospf *ospf, uint8_t type, 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 (DISTRIBUTE_LIST(ospf, type))
if (access_list_apply(DISTRIBUTE_LIST(ospf, type), p) if (access_list_apply(DISTRIBUTE_LIST(ospf, type), p)
== FILTER_DENY) { == FILTER_DENY) {
if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) if (IS_DEBUG_OSPF(zebra, ZEBRA_REDISTRIBUTE)) {
char buf[PREFIX2STR_BUFFER];
zlog_debug( zlog_debug(
"Redistribute[%s]: %s/%d filtered by ditribute-list.", "Redistribute[%s]: %s filtered by distribute-list.",
ospf_redist_string(type), ospf_redist_string(type),
inet_ntoa(p->prefix), prefix2str(p, buf, sizeof(buf)));
p->prefixlen); }
return 0; return 0;
} }
@ -890,11 +894,13 @@ int ospf_redistribute_check(struct ospf *ospf, struct external_info *ei,
if (ret == RMAP_DENYMATCH) { if (ret == RMAP_DENYMATCH) {
ei->route_map_set = save_values; 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( zlog_debug(
"Redistribute[%s]: %s/%d filtered by route-map.", "Redistribute[%s]: %s filtered by route-map.",
ospf_redist_string(type), ospf_redist_string(type),
inet_ntoa(p->prefix), p->prefixlen); prefix2str(p, buf, sizeof(buf)));
}
return 0; return 0;
} }