diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-10-22 08:07:57 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-22 08:07:57 -0400 |
| commit | 84de5a245a3eb17619588a535b9f408ce802a8c9 (patch) | |
| tree | 30eafbdeaf55a170d2bf8d7be0c1b1f34cfc4f90 /eigrpd | |
| parent | e58496183e278767da2cb0886f90397e50cfa5ef (diff) | |
| parent | 2dbe669bdf0f0bcbf0228ccdab7b631bd8b934f1 (diff) | |
Merge pull request #7343 from ton31337/fix/prefix2str_to_pFX
:* Convert prefix2str to %pFX
Diffstat (limited to 'eigrpd')
| -rw-r--r-- | eigrpd/eigrp_dump.c | 4 | ||||
| -rw-r--r-- | eigrpd/eigrp_reply.c | 7 | ||||
| -rw-r--r-- | eigrpd/eigrp_topology.c | 10 | ||||
| -rw-r--r-- | eigrpd/eigrp_update.c | 6 | ||||
| -rw-r--r-- | eigrpd/eigrp_zebra.c | 32 |
5 files changed, 19 insertions, 40 deletions
diff --git a/eigrpd/eigrp_dump.c b/eigrpd/eigrp_dump.c index 924c169da1..dfce2acad4 100644 --- a/eigrpd/eigrp_dump.c +++ b/eigrpd/eigrp_dump.c @@ -239,12 +239,10 @@ void show_ip_eigrp_topology_header(struct vty *vty, struct eigrp *eigrp) void show_ip_eigrp_prefix_entry(struct vty *vty, struct eigrp_prefix_entry *tn) { struct list *successors = eigrp_topology_get_successor(tn); - char buffer[PREFIX_STRLEN]; vty_out(vty, "%-3c", (tn->state > 0) ? 'A' : 'P'); - vty_out(vty, "%s, ", - prefix2str(tn->destination, buffer, PREFIX_STRLEN)); + vty_out(vty, "%pFX, ", tn->destination); vty_out(vty, "%u successors, ", (successors) ? successors->count : 0); vty_out(vty, "FD is %u, serno: %" PRIu64 " \n", tn->fdistance, tn->serno); diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c index 79405efbbf..26bb27d7ac 100644 --- a/eigrpd/eigrp_reply.c +++ b/eigrpd/eigrp_reply.c @@ -168,13 +168,10 @@ void eigrp_reply_receive(struct eigrp *eigrp, struct ip *iph, * Destination must exists */ if (!dest) { - char buf[PREFIX_STRLEN]; - flog_err( EC_EIGRP_PACKET, - "%s: Received prefix %s which we do not know about", - __func__, - prefix2str(&dest_addr, buf, sizeof(buf))); + "%s: Received prefix %pFX which we do not know about", + __func__, &dest_addr); eigrp_IPv4_InternalTLV_free(tlv); continue; } diff --git a/eigrpd/eigrp_topology.c b/eigrpd/eigrp_topology.c index 7676af15f2..2dbee16694 100644 --- a/eigrpd/eigrp_topology.c +++ b/eigrpd/eigrp_topology.c @@ -133,14 +133,10 @@ void eigrp_prefix_entry_add(struct route_table *topology, rn = route_node_get(topology, pe->destination); if (rn->info) { - if (IS_DEBUG_EIGRP_EVENT) { - char buf[PREFIX_STRLEN]; - + if (IS_DEBUG_EIGRP_EVENT) zlog_debug( - "%s: %s Should we have found this entry in the topo table?", - __func__, - prefix2str(pe->destination, buf, sizeof(buf))); - } + "%s: %pFX Should we have found this entry in the topo table?", + __func__, pe->destination); route_unlock_node(rn); } diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index b99e70b407..cd30eb5ab5 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -141,10 +141,8 @@ static void eigrp_update_receive_GR_ask(struct eigrp *eigrp, /* iterate over all prefixes which weren't advertised by neighbor */ for (ALL_LIST_ELEMENTS_RO(nbr_prefixes, node1, prefix)) { - char buffer[PREFIX_STRLEN]; - zlog_debug( - "GR receive: Neighbor not advertised %s", - prefix2str(prefix->destination, buffer, PREFIX_STRLEN)); + zlog_debug("GR receive: Neighbor not advertised %pFX", + prefix->destination); fsm_msg.metrics = prefix->reported_metric; /* set delay to MAX */ diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c index 3205f13922..473cc75a2a 100644 --- a/eigrpd/eigrp_zebra.c +++ b/eigrpd/eigrp_zebra.c @@ -150,12 +150,9 @@ static int eigrp_interface_address_add(ZAPI_CALLBACK_ARGS) if (c == NULL) return 0; - if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE)) { - char buf[128]; - prefix2str(c->address, buf, sizeof(buf)); - zlog_debug("Zebra: interface %s address add %s", c->ifp->name, - buf); - } + if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE)) + zlog_debug("Zebra: interface %s address add %pFX", c->ifp->name, + c->address); eigrp_if_update(c->ifp); @@ -173,12 +170,9 @@ static int eigrp_interface_address_delete(ZAPI_CALLBACK_ARGS) if (c == NULL) return 0; - if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE)) { - char buf[128]; - prefix2str(c->address, buf, sizeof(buf)); - zlog_debug("Zebra: interface %s address delete %s", - c->ifp->name, buf); - } + if (IS_DEBUG_EIGRP(zebra, ZEBRA_INTERFACE)) + zlog_debug("Zebra: interface %s address delete %pFX", + c->ifp->name, c->address); ifp = c->ifp; ei = ifp->info; @@ -234,10 +228,9 @@ void eigrp_zebra_route_add(struct eigrp *eigrp, struct prefix *p, api.nexthop_num = count; if (IS_DEBUG_EIGRP(zebra, ZEBRA_REDISTRIBUTE)) { - char buf[2][PREFIX_STRLEN]; - zlog_debug("Zebra: Route add %s nexthop %s", - prefix2str(p, buf[0], PREFIX_STRLEN), - inet_ntop(AF_INET, 0, buf[1], PREFIX_STRLEN)); + char buf[PREFIX_STRLEN]; + zlog_debug("Zebra: Route add %pFX nexthop %s", p, + inet_ntop(AF_INET, 0, buf, PREFIX_STRLEN)); } zclient_route_send(ZEBRA_ROUTE_ADD, zclient, &api); @@ -257,11 +250,8 @@ void eigrp_zebra_route_delete(struct eigrp *eigrp, struct prefix *p) memcpy(&api.prefix, p, sizeof(*p)); zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api); - if (IS_DEBUG_EIGRP(zebra, ZEBRA_REDISTRIBUTE)) { - char buf[PREFIX_STRLEN]; - zlog_debug("Zebra: Route del %s", - prefix2str(p, buf, PREFIX_STRLEN)); - } + if (IS_DEBUG_EIGRP(zebra, ZEBRA_REDISTRIBUTE)) + zlog_debug("Zebra: Route del %pFX", p); return; } |
