diff options
Diffstat (limited to 'zebra/redistribute.c')
| -rw-r--r-- | zebra/redistribute.c | 60 |
1 files changed, 24 insertions, 36 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c index c0f89e6afe..1f075cfb4b 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -119,18 +119,17 @@ static void zebra_redistribute(struct zserv *client, int type, for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) RNODE_FOREACH_RE (rn, newre) { const struct prefix *dst_p, *src_p; - char buf[PREFIX_STRLEN]; srcdest_rnode_prefixes(rn, &dst_p, &src_p); if (IS_ZEBRA_DEBUG_RIB) zlog_debug( - "%s: client %s %s(%u) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d", + "%s: client %s %pFX(%u) checking: selected=%d, type=%d, distance=%d, metric=%d zebra_check_addr=%d", __func__, zebra_route_string(client->proto), - prefix2str(dst_p, buf, sizeof(buf)), - vrf_id, CHECK_FLAG(newre->flags, - ZEBRA_FLAG_SELECTED), + dst_p, vrf_id, + CHECK_FLAG(newre->flags, + ZEBRA_FLAG_SELECTED), newre->type, newre->distance, newre->metric, zebra_check_addr(dst_p)); @@ -196,15 +195,13 @@ void redistribute_update(const struct prefix *p, const struct prefix *src_p, struct listnode *node, *nnode; struct zserv *client; int afi; - char buf[PREFIX_STRLEN]; - if (IS_ZEBRA_DEBUG_RIB) { + if (IS_ZEBRA_DEBUG_RIB) zlog_debug( - "(%u:%u):%s: Redist update re %p (%s), old %p (%s)", - re->vrf_id, re->table, prefix2str(p, buf, sizeof(buf)), - re, zebra_route_string(re->type), prev_re, + "(%u:%u):%pFX: Redist update re %p (%s), old %p (%s)", + re->vrf_id, re->table, p, re, + zebra_route_string(re->type), prev_re, prev_re ? zebra_route_string(prev_re->type) : "None"); - } afi = family2afi(p->family); if (!afi) { @@ -214,8 +211,7 @@ void redistribute_update(const struct prefix *p, const struct prefix *src_p, } if (!zebra_check_addr(p)) { if (IS_ZEBRA_DEBUG_RIB) - zlog_debug("Redist update filter prefix %s", - prefix2str(p, buf, sizeof(buf))); + zlog_debug("Redist update filter prefix %pFX", p); return; } @@ -224,10 +220,9 @@ void redistribute_update(const struct prefix *p, const struct prefix *src_p, if (zebra_redistribute_check(re, client, p, afi)) { if (IS_ZEBRA_DEBUG_RIB) { zlog_debug( - "%s: client %s %s(%u:%u), type=%d, distance=%d, metric=%d", + "%s: client %s %pFX(%u:%u), type=%d, distance=%d, metric=%d", __func__, - zebra_route_string(client->proto), - prefix2str(p, buf, sizeof(buf)), + zebra_route_string(client->proto), p, re->vrf_id, re->table, re->type, re->distance, re->metric); } @@ -254,7 +249,6 @@ void redistribute_delete(const struct prefix *p, const struct prefix *src_p, struct listnode *node, *nnode; struct zserv *client; int afi; - char buf[PREFIX_STRLEN]; vrf_id_t vrfid; if (old_re) @@ -265,13 +259,11 @@ void redistribute_delete(const struct prefix *p, const struct prefix *src_p, return; if (IS_ZEBRA_DEBUG_RIB) { - zlog_debug( - "%u:%s: Redist del: re %p (%s), new re %p (%s)", - vrfid, prefix2str(p, buf, sizeof(buf)), - old_re, - old_re ? zebra_route_string(old_re->type) : "None", - new_re, - new_re ? zebra_route_string(new_re->type) : "None"); + zlog_debug("%u:%pFX: Redist del: re %p (%s), new re %p (%s)", + vrfid, p, old_re, + old_re ? zebra_route_string(old_re->type) : "None", + new_re, + new_re ? zebra_route_string(new_re->type) : "None"); } /* Add DISTANCE_INFINITY check. */ @@ -293,8 +285,8 @@ void redistribute_delete(const struct prefix *p, const struct prefix *src_p, if (!zebra_check_addr(p)) { if (IS_ZEBRA_DEBUG_RIB) { zlog_debug( - "%u:%s: Redist del old: skipping invalid prefix", - vrfid, prefix2str(p, buf, sizeof(buf))); + "%u:%pFX: Redist del old: skipping invalid prefix", + vrfid, p); } return; } @@ -541,12 +533,10 @@ void zebra_interface_address_add_update(struct interface *ifp, struct prefix *p; if (IS_ZEBRA_DEBUG_EVENT) { - char buf[PREFIX_STRLEN]; - p = ifc->address; - zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADDRESS_ADD %s on %s(%u)", - prefix2str(p, buf, sizeof(buf)), ifp->name, - ifp->vrf_id); + zlog_debug( + "MESSAGE: ZEBRA_INTERFACE_ADDRESS_ADD %pFX on %s(%u)", + p, ifp->name, ifp->vrf_id); } if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) @@ -580,12 +570,10 @@ void zebra_interface_address_delete_update(struct interface *ifp, struct prefix *p; if (IS_ZEBRA_DEBUG_EVENT) { - char buf[PREFIX_STRLEN]; - p = ifc->address; - zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADDRESS_DELETE %s on %s(%u)", - prefix2str(p, buf, sizeof(buf)), - ifp->name, ifp->vrf_id); + zlog_debug( + "MESSAGE: ZEBRA_INTERFACE_ADDRESS_DELETE %pFX on %s(%u)", + p, ifp->name, ifp->vrf_id); } zebra_vxlan_add_del_gw_macip(ifp, ifc->address, 0); |
