mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 06:34:51 +00:00
Merge pull request #7372 from mjstapp/fix_ntoa_ripd
ripd, staticd, isisd, babeld: replace inet_ntoa
This commit is contained in:
commit
a927c1556d
@ -59,24 +59,16 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
||||
if (access_list_apply (babel_ifp->list[distribute], &p)
|
||||
== FILTER_DENY) {
|
||||
debugf(BABEL_DEBUG_FILTER,
|
||||
"%s/%d filtered by distribute %s",
|
||||
p.family == AF_INET ?
|
||||
inet_ntoa(p.u.prefix4) :
|
||||
inet6_ntoa (p.u.prefix6),
|
||||
p.prefixlen,
|
||||
output ? "out" : "in");
|
||||
"%pFX filtered by distribute %s",
|
||||
&p, output ? "out" : "in");
|
||||
return INFINITY;
|
||||
}
|
||||
}
|
||||
if (babel_ifp != NULL && babel_ifp->prefix[distribute]) {
|
||||
if (prefix_list_apply (babel_ifp->prefix[distribute], &p)
|
||||
== PREFIX_DENY) {
|
||||
debugf(BABEL_DEBUG_FILTER, "%s/%d filtered by distribute %s",
|
||||
p.family == AF_INET ?
|
||||
inet_ntoa(p.u.prefix4) :
|
||||
inet6_ntoa (p.u.prefix6),
|
||||
p.prefixlen,
|
||||
output ? "out" : "in");
|
||||
debugf(BABEL_DEBUG_FILTER, "%pFX filtered by distribute %s",
|
||||
&p, output ? "out" : "in");
|
||||
return INFINITY;
|
||||
}
|
||||
}
|
||||
@ -91,12 +83,8 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
||||
|
||||
if (alist) {
|
||||
if (access_list_apply (alist, &p) == FILTER_DENY) {
|
||||
debugf(BABEL_DEBUG_FILTER,"%s/%d filtered by distribute %s",
|
||||
p.family == AF_INET ?
|
||||
inet_ntoa(p.u.prefix4) :
|
||||
inet6_ntoa (p.u.prefix6),
|
||||
p.prefixlen,
|
||||
output ? "out" : "in");
|
||||
debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s",
|
||||
&p, output ? "out" : "in");
|
||||
return INFINITY;
|
||||
}
|
||||
}
|
||||
@ -105,12 +93,8 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
||||
plist = prefix_list_lookup (p.family, dist->prefix[distribute]);
|
||||
if (plist) {
|
||||
if (prefix_list_apply (plist, &p) == PREFIX_DENY) {
|
||||
debugf(BABEL_DEBUG_FILTER,"%s/%d filtered by distribute %s",
|
||||
p.family == AF_INET ?
|
||||
inet_ntoa(p.u.prefix4) :
|
||||
inet6_ntoa (p.u.prefix6),
|
||||
p.prefixlen,
|
||||
output ? "out" : "in");
|
||||
debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s",
|
||||
&p, output ? "out" : "in");
|
||||
return INFINITY;
|
||||
}
|
||||
}
|
||||
|
@ -1106,6 +1106,7 @@ DEFUN (show_babel_route_addr,
|
||||
{
|
||||
struct in_addr addr;
|
||||
char buf[INET_ADDRSTRLEN + 8];
|
||||
char buf1[INET_ADDRSTRLEN + 8];
|
||||
struct route_stream *routes = NULL;
|
||||
struct xroute_stream *xroutes = NULL;
|
||||
struct prefix prefix;
|
||||
@ -1118,7 +1119,8 @@ DEFUN (show_babel_route_addr,
|
||||
}
|
||||
|
||||
/* Quagga has no convenient prefix constructors. */
|
||||
snprintf(buf, sizeof(buf), "%s/%d", inet_ntoa(addr), 32);
|
||||
snprintf(buf, sizeof(buf), "%s/%d",
|
||||
inet_ntop(AF_INET, &addr, buf1, sizeof(buf1)), 32);
|
||||
|
||||
ret = str2prefix(buf, &prefix);
|
||||
if (ret == 0) {
|
||||
|
@ -393,7 +393,7 @@ void isis_adj_print(struct isis_adjacency *adj)
|
||||
if (adj->ipv4_address_count) {
|
||||
zlog_debug("IPv4 Address(es):");
|
||||
for (unsigned int i = 0; i < adj->ipv4_address_count; i++)
|
||||
zlog_debug("%s", inet_ntoa(adj->ipv4_addresses[i]));
|
||||
zlog_debug("%pI4", &adj->ipv4_addresses[i]);
|
||||
}
|
||||
|
||||
if (adj->ipv6_address_count) {
|
||||
@ -562,8 +562,8 @@ void isis_adj_print_vty(struct isis_adjacency *adj, struct vty *vty,
|
||||
vty_out(vty, " IPv4 Address(es):\n");
|
||||
for (unsigned int i = 0; i < adj->ipv4_address_count;
|
||||
i++)
|
||||
vty_out(vty, " %s\n",
|
||||
inet_ntoa(adj->ipv4_addresses[i]));
|
||||
vty_out(vty, " %pI4\n",
|
||||
&adj->ipv4_addresses[i]);
|
||||
}
|
||||
if (adj->ipv6_address_count) {
|
||||
vty_out(vty, " IPv6 Address(es):\n");
|
||||
|
@ -336,10 +336,8 @@ DEFUN(show_isis_mpls_te_router,
|
||||
if (ntohs(area->mta->router_id.s_addr)
|
||||
!= 0)
|
||||
vty_out(vty,
|
||||
" MPLS-TE Router-Address: %s\n",
|
||||
inet_ntoa(
|
||||
area->mta
|
||||
->router_id));
|
||||
" MPLS-TE Router-Address: %pI4\n",
|
||||
&area->mta->router_id);
|
||||
else
|
||||
vty_out(vty, " N/A\n");
|
||||
}
|
||||
@ -357,9 +355,8 @@ DEFUN(show_isis_mpls_te_router,
|
||||
vty_out(vty, "Area %s:\n", area->area_tag);
|
||||
if (ntohs(area->mta->router_id.s_addr) != 0)
|
||||
vty_out(vty,
|
||||
" MPLS-TE Router-Address: %s\n",
|
||||
inet_ntoa(
|
||||
area->mta->router_id));
|
||||
" MPLS-TE Router-Address: %pI4\n",
|
||||
&area->mta->router_id);
|
||||
else
|
||||
vty_out(vty, " N/A\n");
|
||||
}
|
||||
@ -394,11 +391,11 @@ static void show_ext_sub(struct vty *vty, char *name,
|
||||
ext->remote_llri);
|
||||
}
|
||||
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR))
|
||||
sbuf_push(&buf, 4, "Local Interface IP Address(es): %s\n",
|
||||
inet_ntoa(ext->local_addr));
|
||||
sbuf_push(&buf, 4, "Local Interface IP Address(es): %pI4\n",
|
||||
&ext->local_addr);
|
||||
if (IS_SUBTLV(ext, EXT_NEIGH_ADDR))
|
||||
sbuf_push(&buf, 4, "Remote Interface IP Address(es): %s\n",
|
||||
inet_ntoa(ext->neigh_addr));
|
||||
sbuf_push(&buf, 4, "Remote Interface IP Address(es): %pI4\n",
|
||||
&ext->neigh_addr);
|
||||
if (IS_SUBTLV(ext, EXT_LOCAL_ADDR6))
|
||||
sbuf_push(&buf, 4, "Local Interface IPv6 Address(es): %s\n",
|
||||
inet_ntop(AF_INET6, &ext->local_addr6, ibuf,
|
||||
@ -432,8 +429,8 @@ static void show_ext_sub(struct vty *vty, char *name,
|
||||
ext->remote_as);
|
||||
if (IS_SUBTLV(ext, EXT_RMT_IP))
|
||||
sbuf_push(&buf, 4,
|
||||
"Inter-AS TE Remote ASBR IP address: %s\n",
|
||||
inet_ntoa(ext->remote_ip));
|
||||
"Inter-AS TE Remote ASBR IP address: %pI4\n",
|
||||
&ext->remote_ip);
|
||||
if (IS_SUBTLV(ext, EXT_DELAY))
|
||||
sbuf_push(&buf, 4,
|
||||
"%s Average Link Delay: %u (micro-sec)\n",
|
||||
|
@ -209,11 +209,11 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
|
||||
exts->remote_llri);
|
||||
}
|
||||
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR))
|
||||
sbuf_push(buf, indent, "Local Interface IP Address(es): %s\n",
|
||||
inet_ntoa(exts->local_addr));
|
||||
sbuf_push(buf, indent, "Local Interface IP Address(es): %pI4\n",
|
||||
&exts->local_addr);
|
||||
if (IS_SUBTLV(exts, EXT_NEIGH_ADDR))
|
||||
sbuf_push(buf, indent, "Remote Interface IP Address(es): %s\n",
|
||||
inet_ntoa(exts->neigh_addr));
|
||||
sbuf_push(buf, indent, "Remote Interface IP Address(es): %pI4\n",
|
||||
&exts->neigh_addr);
|
||||
if (IS_SUBTLV(exts, EXT_LOCAL_ADDR6))
|
||||
sbuf_push(buf, indent, "Local Interface IPv6 Address(es): %s\n",
|
||||
inet_ntop(AF_INET6, &exts->local_addr6, ibuf,
|
||||
@ -247,8 +247,8 @@ static void format_item_ext_subtlvs(struct isis_ext_subtlvs *exts,
|
||||
exts->remote_as);
|
||||
if (IS_SUBTLV(exts, EXT_RMT_IP))
|
||||
sbuf_push(buf, indent,
|
||||
"Inter-AS TE Remote ASBR IP address: %s\n",
|
||||
inet_ntoa(exts->remote_ip));
|
||||
"Inter-AS TE Remote ASBR IP address: %pI4\n",
|
||||
&exts->remote_ip);
|
||||
/* Extended metrics */
|
||||
if (IS_SUBTLV(exts, EXT_DELAY))
|
||||
sbuf_push(buf, indent,
|
||||
|
@ -172,8 +172,8 @@ static void rip_request_interface_send(struct interface *ifp, uint8_t version)
|
||||
continue;
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("SEND request to %s",
|
||||
inet_ntoa(to.sin_addr));
|
||||
zlog_debug("SEND request to %pI4",
|
||||
&to.sin_addr);
|
||||
|
||||
rip_request_send(&to, ifp, version, connected);
|
||||
}
|
||||
@ -1174,9 +1174,7 @@ int rip_show_network_config(struct vty *vty, struct rip *rip)
|
||||
for (node = route_top(rip->enable_network); node;
|
||||
node = route_next(node))
|
||||
if (node->info)
|
||||
vty_out(vty, " %s/%u\n",
|
||||
inet_ntoa(node->p.u.prefix4),
|
||||
node->p.prefixlen);
|
||||
vty_out(vty, " %pFX\n", &node->p);
|
||||
|
||||
/* Interface name RIP enable statement. */
|
||||
for (i = 0; i < vector_active(rip->enable_interface); i++)
|
||||
@ -1186,7 +1184,7 @@ int rip_show_network_config(struct vty *vty, struct rip *rip)
|
||||
/* RIP neighbors listing. */
|
||||
for (node = route_top(rip->neighbor); node; node = route_next(node))
|
||||
if (node->info)
|
||||
vty_out(vty, " %s\n", inet_ntoa(node->p.u.prefix4));
|
||||
vty_out(vty, " %pI4\n", &node->p.u.prefix4);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -155,8 +155,8 @@ void rip_peer_display(struct vty *vty, struct rip *rip)
|
||||
char timebuf[RIP_UPTIME_LEN];
|
||||
|
||||
for (ALL_LIST_ELEMENTS(rip->peer_list, node, nnode, peer)) {
|
||||
vty_out(vty, " %-16s %9d %9d %9d %s\n",
|
||||
inet_ntoa(peer->addr), peer->recv_badpackets,
|
||||
vty_out(vty, " %-16pI4 %9d %9d %9d %s\n",
|
||||
&peer->addr, peer->recv_badpackets,
|
||||
peer->recv_badroutes, ZEBRA_RIP_DISTANCE_DEFAULT,
|
||||
rip_peer_uptime(peer, timebuf, RIP_UPTIME_LEN));
|
||||
}
|
||||
|
@ -88,18 +88,16 @@ static void rip_zebra_ipv4_send(struct rip *rip, struct route_node *rp,
|
||||
|
||||
if (IS_RIP_DEBUG_ZEBRA) {
|
||||
if (rip->ecmp)
|
||||
zlog_debug("%s: %s/%d nexthops %d",
|
||||
zlog_debug("%s: %pFX nexthops %d",
|
||||
(cmd == ZEBRA_ROUTE_ADD)
|
||||
? "Install into zebra"
|
||||
: "Delete from zebra",
|
||||
inet_ntoa(rp->p.u.prefix4), rp->p.prefixlen,
|
||||
count);
|
||||
&rp->p, count);
|
||||
else
|
||||
zlog_debug("%s: %s/%d",
|
||||
zlog_debug("%s: %pFX",
|
||||
(cmd == ZEBRA_ROUTE_ADD)
|
||||
? "Install into zebra"
|
||||
: "Delete from zebra",
|
||||
inet_ntoa(rp->p.u.prefix4), rp->p.prefixlen);
|
||||
: "Delete from zebra", &rp->p);
|
||||
}
|
||||
|
||||
rip->counters.route_changes++;
|
||||
|
128
ripd/ripd.c
128
ripd/ripd.c
@ -45,6 +45,7 @@
|
||||
#include "lib_errors.h"
|
||||
#include "northbound_cli.h"
|
||||
#include "network.h"
|
||||
#include "lib/printfrr.h"
|
||||
|
||||
#include "ripd/ripd.h"
|
||||
#include "ripd/rip_nb.h"
|
||||
@ -466,8 +467,8 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from,
|
||||
if (ret == RMAP_DENYMATCH) {
|
||||
if (IS_RIP_DEBUG_PACKET)
|
||||
zlog_debug(
|
||||
"RIP %s/%d is filtered by route-map in",
|
||||
inet_ntoa(p.prefix), p.prefixlen);
|
||||
"RIP %pFX is filtered by route-map in",
|
||||
&p);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -502,8 +503,8 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from,
|
||||
/* Check if nexthop address is myself, then do nothing. */
|
||||
if (rip_nexthop_check(rip, nexthop) < 0) {
|
||||
if (IS_RIP_DEBUG_PACKET)
|
||||
zlog_debug("Nexthop address %s is myself",
|
||||
inet_ntoa(*nexthop));
|
||||
zlog_debug("Nexthop address %pI4 is myself",
|
||||
nexthop);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -830,8 +831,8 @@ static int rip_auth_simple_password(struct rte *rte, struct sockaddr_in *from,
|
||||
}
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("RIPv2 simple password authentication from %s",
|
||||
inet_ntoa(from->sin_addr));
|
||||
zlog_debug("RIPv2 simple password authentication from %pI4",
|
||||
&from->sin_addr);
|
||||
|
||||
ri = ifp->info;
|
||||
|
||||
@ -878,8 +879,8 @@ static int rip_auth_md5(struct rip_packet *packet, struct sockaddr_in *from,
|
||||
char auth_str[RIP_AUTH_MD5_SIZE] = {};
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("RIPv2 MD5 authentication from %s",
|
||||
inet_ntoa(from->sin_addr));
|
||||
zlog_debug("RIPv2 MD5 authentication from %pI4",
|
||||
&from->sin_addr);
|
||||
|
||||
ri = ifp->info;
|
||||
md5 = (struct rip_md5_info *)&packet->rte;
|
||||
@ -1160,8 +1161,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
rip->vrf->vrf_id)
|
||||
== NULL) {
|
||||
zlog_info(
|
||||
"This datagram doesn't came from a valid neighbor: %s",
|
||||
inet_ntoa(from->sin_addr));
|
||||
"This datagram doesn't come from a valid neighbor: %pI4",
|
||||
&from->sin_addr);
|
||||
rip_peer_bad_packet(rip, from);
|
||||
return;
|
||||
}
|
||||
@ -1190,9 +1191,9 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
|
||||
if (rte->family != htons(AF_INET)) {
|
||||
/* Address family check. RIP only supports AF_INET. */
|
||||
zlog_info("Unsupported family %d from %s.",
|
||||
zlog_info("Unsupported family %d from %pI4",
|
||||
ntohs(rte->family),
|
||||
inet_ntoa(from->sin_addr));
|
||||
&from->sin_addr);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1218,8 +1219,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
/* RIPv1 does not have nexthop value. */
|
||||
if (packet->version == RIPv1
|
||||
&& rte->nexthop.s_addr != INADDR_ANY) {
|
||||
zlog_info("RIPv1 packet with nexthop value %s",
|
||||
inet_ntoa(rte->nexthop));
|
||||
zlog_info("RIPv1 packet with nexthop value %pI4",
|
||||
&rte->nexthop);
|
||||
rip_peer_bad_route(rip, from);
|
||||
continue;
|
||||
}
|
||||
@ -1236,8 +1237,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
addrval = ntohl(rte->nexthop.s_addr);
|
||||
if (IN_CLASSD(addrval)) {
|
||||
zlog_info(
|
||||
"Nexthop %s is multicast address, skip this rte",
|
||||
inet_ntoa(rte->nexthop));
|
||||
"Nexthop %pI4 is multicast address, skip this rte",
|
||||
&rte->nexthop);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1257,16 +1258,14 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
== RIP_ROUTE_RTE) {
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug(
|
||||
"Next hop %s is on RIP network. Set nexthop to the packet's originator",
|
||||
inet_ntoa(
|
||||
rte->nexthop));
|
||||
"Next hop %pI4 is on RIP network. Set nexthop to the packet's originator",
|
||||
&rte->nexthop);
|
||||
rte->nexthop = rinfo->from;
|
||||
} else {
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug(
|
||||
"Next hop %s is not directly reachable. Treat it as 0.0.0.0",
|
||||
inet_ntoa(
|
||||
rte->nexthop));
|
||||
"Next hop %pI4 is not directly reachable. Treat it as 0.0.0.0",
|
||||
&rte->nexthop);
|
||||
rte->nexthop.s_addr =
|
||||
INADDR_ANY;
|
||||
}
|
||||
@ -1275,9 +1274,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
} else {
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug(
|
||||
"Next hop %s is not directly reachable. Treat it as 0.0.0.0",
|
||||
inet_ntoa(
|
||||
rte->nexthop));
|
||||
"Next hop %pI4 is not directly reachable. Treat it as 0.0.0.0",
|
||||
&rte->nexthop);
|
||||
rte->nexthop.s_addr = INADDR_ANY;
|
||||
}
|
||||
}
|
||||
@ -1331,8 +1329,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
!= rte->prefix.s_addr)
|
||||
masklen2ip(32, &rte->mask);
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("Subnetted route %s",
|
||||
inet_ntoa(rte->prefix));
|
||||
zlog_debug("Subnetted route %pI4",
|
||||
&rte->prefix);
|
||||
} else {
|
||||
if ((rte->prefix.s_addr & rte->mask.s_addr)
|
||||
!= rte->prefix.s_addr)
|
||||
@ -1340,10 +1338,10 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
}
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT) {
|
||||
zlog_debug("Resultant route %s",
|
||||
inet_ntoa(rte->prefix));
|
||||
zlog_debug("Resultant mask %s",
|
||||
inet_ntoa(rte->mask));
|
||||
zlog_debug("Resultant route %pI4",
|
||||
&rte->prefix);
|
||||
zlog_debug("Resultant mask %pI4",
|
||||
&rte->mask);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1354,8 +1352,8 @@ static void rip_response_process(struct rip_packet *packet, int size,
|
||||
&& ((rte->prefix.s_addr & rte->mask.s_addr)
|
||||
!= rte->prefix.s_addr)) {
|
||||
zlog_warn(
|
||||
"RIPv2 address %s is not mask /%d applied one",
|
||||
inet_ntoa(rte->prefix), ip_masklen(rte->mask));
|
||||
"RIPv2 address %pI4 is not mask /%d applied one",
|
||||
&rte->prefix, ip_masklen(rte->mask));
|
||||
rip_peer_bad_route(rip, from);
|
||||
continue;
|
||||
}
|
||||
@ -1418,8 +1416,8 @@ int rip_create_socket(struct vrf *vrf)
|
||||
frr_with_privs(&ripd_privs) {
|
||||
if ((ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr)))
|
||||
< 0) {
|
||||
zlog_err("%s: Can't bind socket %d to %s port %d: %s",
|
||||
__func__, sock, inet_ntoa(addr.sin_addr),
|
||||
zlog_err("%s: Can't bind socket %d to %pI4 port %d: %s",
|
||||
__func__, sock, &addr.sin_addr,
|
||||
(int)ntohs(addr.sin_port),
|
||||
safe_strerror(errno));
|
||||
|
||||
@ -1459,14 +1457,14 @@ static int rip_send_packet(uint8_t *buf, int size, struct sockaddr_in *to,
|
||||
char dst[ADDRESS_SIZE];
|
||||
|
||||
if (to) {
|
||||
strlcpy(dst, inet_ntoa(to->sin_addr), sizeof(dst));
|
||||
inet_ntop(AF_INET, &to->sin_addr, dst, sizeof(dst));
|
||||
} else {
|
||||
sin.sin_addr.s_addr = htonl(INADDR_RIP_GROUP);
|
||||
strlcpy(dst, inet_ntoa(sin.sin_addr), sizeof(dst));
|
||||
inet_ntop(AF_INET, &sin.sin_addr, dst, sizeof(dst));
|
||||
}
|
||||
#undef ADDRESS_SIZE
|
||||
zlog_debug("rip_send_packet %s > %s (%s)",
|
||||
inet_ntoa(ifc->address->u.prefix4), dst,
|
||||
zlog_debug("rip_send_packet %pI4 > %s (%s)",
|
||||
&ifc->address->u.prefix4, dst,
|
||||
ifc->ifp->name);
|
||||
}
|
||||
|
||||
@ -1533,7 +1531,7 @@ static int rip_send_packet(uint8_t *buf, int size, struct sockaddr_in *to,
|
||||
ret = sendmsg(rip->sock, &msg, 0);
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("SEND to %s.%d", inet_ntoa(sin.sin_addr),
|
||||
zlog_debug("SEND to %pI4%d", &sin.sin_addr,
|
||||
ntohs(sin.sin_port));
|
||||
|
||||
if (ret < 0)
|
||||
@ -1782,15 +1780,15 @@ static int rip_read(struct thread *t)
|
||||
|
||||
/* RIP packet received */
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("RECV packet from %s port %d on %s (VRF %s)",
|
||||
inet_ntoa(from.sin_addr), ntohs(from.sin_port),
|
||||
zlog_debug("RECV packet from %pI4 port %d on %s (VRF %s)",
|
||||
&from.sin_addr, ntohs(from.sin_port),
|
||||
ifp ? ifp->name : "unknown", rip->vrf_name);
|
||||
|
||||
/* If this packet come from unknown interface, ignore it. */
|
||||
if (ifp == NULL) {
|
||||
zlog_info(
|
||||
"rip_read: cannot find interface for packet from %s port %d (VRF %s)",
|
||||
inet_ntoa(from.sin_addr), ntohs(from.sin_port),
|
||||
"rip_read: cannot find interface for packet from %pI4 port %d (VRF %s)",
|
||||
&from.sin_addr, ntohs(from.sin_port),
|
||||
rip->vrf_name);
|
||||
return -1;
|
||||
}
|
||||
@ -1803,8 +1801,8 @@ static int rip_read(struct thread *t)
|
||||
|
||||
if (ifc == NULL) {
|
||||
zlog_info(
|
||||
"rip_read: cannot find connected address for packet from %s port %d on interface %s (VRF %s)",
|
||||
inet_ntoa(from.sin_addr), ntohs(from.sin_port),
|
||||
"rip_read: cannot find connected address for packet from %pI4 port %d on interface %s (VRF %s)",
|
||||
&from.sin_addr, ntohs(from.sin_port),
|
||||
ifp->name, rip->vrf_name);
|
||||
return -1;
|
||||
}
|
||||
@ -2077,8 +2075,8 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
||||
/* Logging output event. */
|
||||
if (IS_RIP_DEBUG_EVENT) {
|
||||
if (to)
|
||||
zlog_debug("update routes to neighbor %s",
|
||||
inet_ntoa(to->sin_addr));
|
||||
zlog_debug("update routes to neighbor %pI4",
|
||||
&to->sin_addr);
|
||||
else
|
||||
zlog_debug("update routes on interface %s ifindex %d",
|
||||
ifc->ifp->name, ifc->ifp->ifindex);
|
||||
@ -2143,9 +2141,8 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
||||
|
||||
if (IS_RIP_DEBUG_PACKET)
|
||||
zlog_debug(
|
||||
"RIPv1 mask check, %s/%d considered for output",
|
||||
inet_ntoa(rp->p.u.prefix4),
|
||||
rp->p.prefixlen);
|
||||
"RIPv1 mask check, %pFX considered for output",
|
||||
&rp->p);
|
||||
|
||||
if (subnetted
|
||||
&& prefix_match(
|
||||
@ -2166,9 +2163,8 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
||||
}
|
||||
if (IS_RIP_DEBUG_PACKET)
|
||||
zlog_debug(
|
||||
"RIPv1 mask check, %s/%d made it through",
|
||||
inet_ntoa(rp->p.u.prefix4),
|
||||
rp->p.prefixlen);
|
||||
"RIPv1 mask check, %pFX made it through",
|
||||
&rp->p);
|
||||
} else
|
||||
p = (struct prefix_ipv4 *)&rp->p;
|
||||
|
||||
@ -2452,10 +2448,10 @@ static void rip_update_interface(struct connected *ifc, uint8_t version,
|
||||
to.sin_port = htons(RIP_PORT_DEFAULT);
|
||||
|
||||
if (IS_RIP_DEBUG_EVENT)
|
||||
zlog_debug("%s announce to %s on %s",
|
||||
zlog_debug("%s announce to %pI4 on %s",
|
||||
CONNECTED_PEER(ifc) ? "unicast"
|
||||
: "broadcast",
|
||||
inet_ntoa(to.sin_addr), ifp->name);
|
||||
&to.sin_addr, ifp->name);
|
||||
|
||||
rip_output_process(ifc, &to, route_type, version);
|
||||
}
|
||||
@ -2530,8 +2526,8 @@ static void rip_update_process(struct rip *rip, int route_type)
|
||||
rip->vrf->vrf_id);
|
||||
if (!connected) {
|
||||
zlog_warn(
|
||||
"Neighbor %s doesn't have connected interface!",
|
||||
inet_ntoa(p->u.prefix4));
|
||||
"Neighbor %pI4 doesn't have connected interface!",
|
||||
&p->u.prefix4);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2957,8 +2953,7 @@ static void rip_distance_show(struct vty *vty, struct rip *rip)
|
||||
" Address Distance List\n");
|
||||
header = 0;
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%s/%d",
|
||||
inet_ntoa(rn->p.u.prefix4), rn->p.prefixlen);
|
||||
snprintfrr(buf, sizeof(buf), "%pFX", &rn->p);
|
||||
vty_out(vty, " %-20s %4d %s\n", buf,
|
||||
rdistance->distance,
|
||||
rdistance->access_list ? rdistance->access_list
|
||||
@ -3085,12 +3080,11 @@ DEFUN (show_ip_rip,
|
||||
int len;
|
||||
|
||||
len = vty_out(
|
||||
vty, "%c(%s) %s/%d",
|
||||
vty, "%c(%s) %pFX",
|
||||
/* np->lock, For debugging. */
|
||||
zebra_route_char(rinfo->type),
|
||||
rip_route_type_print(rinfo->sub_type),
|
||||
inet_ntoa(np->p.u.prefix4),
|
||||
np->p.prefixlen);
|
||||
&np->p);
|
||||
|
||||
len = 24 - len;
|
||||
|
||||
@ -3100,8 +3094,8 @@ DEFUN (show_ip_rip,
|
||||
switch (rinfo->nh.type) {
|
||||
case NEXTHOP_TYPE_IPV4:
|
||||
case NEXTHOP_TYPE_IPV4_IFINDEX:
|
||||
vty_out(vty, "%-20s %2d ",
|
||||
inet_ntoa(rinfo->nh.gate.ipv4),
|
||||
vty_out(vty, "%-20pI4 %2d ",
|
||||
&rinfo->nh.gate.ipv4,
|
||||
rinfo->metric);
|
||||
break;
|
||||
case NEXTHOP_TYPE_IFINDEX:
|
||||
@ -3125,8 +3119,8 @@ DEFUN (show_ip_rip,
|
||||
/* Route which exist in kernel routing table. */
|
||||
if ((rinfo->type == ZEBRA_ROUTE_RIP)
|
||||
&& (rinfo->sub_type == RIP_ROUTE_RTE)) {
|
||||
vty_out(vty, "%-15s ",
|
||||
inet_ntoa(rinfo->from));
|
||||
vty_out(vty, "%-15pI4 ",
|
||||
&rinfo->from);
|
||||
vty_out(vty, "%3" ROUTE_TAG_PRI " ",
|
||||
(route_tag_t)rinfo->tag);
|
||||
rip_vty_out_uptime(vty, rinfo);
|
||||
|
@ -365,8 +365,7 @@ int static_config(struct vty *vty, struct static_vrf *svrf, afi_t afi,
|
||||
|
||||
switch (nh->type) {
|
||||
case STATIC_IPV4_GATEWAY:
|
||||
vty_out(vty, " %s",
|
||||
inet_ntoa(nh->addr.ipv4));
|
||||
vty_out(vty, " %pI4", &nh->addr.ipv4);
|
||||
break;
|
||||
case STATIC_IPV6_GATEWAY:
|
||||
vty_out(vty, " %s",
|
||||
|
Loading…
Reference in New Issue
Block a user