if (IS_RIPNG_DEBUG_SEND) {
if (to)
- zlog_debug("send to %s", inet6_ntoa(to->sin6_addr));
+ zlog_debug("send to %pI6", &to->sin6_addr);
zlog_debug(" send interface %s", ifp->name);
zlog_debug(" send packet size %d", bufsize);
}
if (ret < 0) {
if (to)
flog_err_sys(EC_LIB_SOCKET,
- "RIPng send fail on %s to %s: %s",
- ifp->name, inet6_ntoa(to->sin6_addr),
+ "RIPng send fail on %s to %pI6: %s",
+ ifp->name, &to->sin6_addr,
safe_strerror(errno));
else
flog_err_sys(EC_LIB_SOCKET, "RIPng send fail on %s: %s",
for (lim = (caddr_t)packet + size; (caddr_t)rte < lim; rte++) {
if (rte->metric == RIPNG_METRIC_NEXTHOP)
- zlog_debug(" nexthop %s/%d", inet6_ntoa(rte->addr),
+ zlog_debug(" nexthop %pI6/%d", &rte->addr,
rte->prefixlen);
else
- zlog_debug(" %s/%d metric %d tag %" ROUTE_TAG_PRI,
- inet6_ntoa(rte->addr), rte->prefixlen,
+ zlog_debug(" %pI6/%d metric %d tag %" ROUTE_TAG_PRI,
+ &rte->addr, rte->prefixlen,
rte->metric, (route_tag_t)ntohs(rte->tag));
}
}
{
/* Logging before checking RTE. */
if (IS_RIPNG_DEBUG_RECV)
- zlog_debug("RIPng nexthop RTE address %s tag %" ROUTE_TAG_PRI
+ zlog_debug("RIPng nexthop RTE address %pI6 tag %" ROUTE_TAG_PRI
" prefixlen %d",
- inet6_ntoa(rte->addr), (route_tag_t)ntohs(rte->tag),
+ &rte->addr, (route_tag_t)ntohs(rte->tag),
rte->prefixlen);
/* RFC2080 2.1.1 Next Hop:
if (ntohs(rte->tag) != 0)
zlog_warn(
"RIPng nexthop RTE with non zero tag value %" ROUTE_TAG_PRI
- " from %s",
- (route_tag_t)ntohs(rte->tag),
- inet6_ntoa(from->sin6_addr));
+ " from %pI6",
+ (route_tag_t)ntohs(rte->tag), &from->sin6_addr);
if (rte->prefixlen != 0)
zlog_warn(
- "RIPng nexthop RTE with non zero prefixlen value %d from %s",
- rte->prefixlen, inet6_ntoa(from->sin6_addr));
+ "RIPng nexthop RTE with non zero prefixlen value %d from %pI6",
+ rte->prefixlen, &from->sin6_addr);
/* Specifying a value of 0:0:0:0:0:0:0:0 in the prefix field of a
next hop RTE indicates that the next hop address should be the
information is ignored, a possibly sub-optimal, but absolutely
valid, route may be taken. If the received next hop address is not
a link-local address, it should be treated as 0:0:0:0:0:0:0:0. */
- zlog_warn("RIPng nexthop RTE with non link-local address %s from %pI6",
- inet6_ntoa(rte->addr), &from->sin6_addr);
+ zlog_warn("RIPng nexthop RTE with non link-local address %pI6 from %pI6",
+ &rte->addr, &from->sin6_addr);
nexthop->flag = RIPNG_NEXTHOP_UNSPEC;
memset(&nexthop->address, 0, sizeof(struct in6_addr));
if (ret == RMAP_DENYMATCH) {
if (IS_RIPNG_DEBUG_PACKET)
zlog_debug(
- "RIPng %s/%d is filtered by route-map in",
- inet6_ntoa(p.prefix), p.prefixlen);
+ "RIPng %pFX is filtered by route-map in",
+ &p);
return;
}
p, ifindex2ifname(ifindex, ripng->vrf->vrf_id));
else
zlog_debug(
- "Redistribute new prefix %pFX with nexthop %s on the interface %s",
- p, inet6_ntoa(*nexthop),
+ "Redistribute new prefix %pFX with nexthop %pI6 on the interface %s",
+ p, nexthop,
ifindex2ifname(ifindex, ripng->vrf->vrf_id));
}
/* RFC2080 2.4.2 Response Messages:
The Response must be ignored if it is not from the RIPng port. */
if (ntohs(from->sin6_port) != RIPNG_PORT_DEFAULT) {
- zlog_warn("RIPng packet comes from non RIPng port %d from %s",
- ntohs(from->sin6_port), inet6_ntoa(from->sin6_addr));
+ zlog_warn("RIPng packet comes from non RIPng port %d from %pI6",
+ ntohs(from->sin6_port), &from->sin6_addr);
ripng_peer_bad_packet(ripng, from);
return;
}
whether the datagram is from a valid neighbor; the source of the
datagram must be a link-local address. */
if (!IN6_IS_ADDR_LINKLOCAL(&from->sin6_addr)) {
- zlog_warn("RIPng packet comes from non link local address %s",
- inet6_ntoa(from->sin6_addr));
+ zlog_warn("RIPng packet comes from non link local address %pI6",
+ &from->sin6_addr);
ripng_peer_bad_packet(ripng, from);
return;
}
and such datagrams must be ignored. */
if (ripng_lladdr_check(ifp, &from->sin6_addr)) {
zlog_warn(
- "RIPng packet comes from my own link local address %s",
- inet6_ntoa(from->sin6_addr));
+ "RIPng packet comes from my own link local address %pI6",
+ &from->sin6_addr);
ripng_peer_bad_packet(ripng, from);
return;
}
packets) must be examined to ensure that the hop count is 255. */
if (hoplimit >= 0 && hoplimit != 255) {
zlog_warn(
- "RIPng packet comes with non 255 hop count %d from %s",
- hoplimit, inet6_ntoa(from->sin6_addr));
+ "RIPng packet comes with non 255 hop count %d from %pI6",
+ hoplimit, &from->sin6_addr);
ripng_peer_bad_packet(ripng, from);
return;
}
should never be present in an RTE. */
if (IN6_IS_ADDR_MULTICAST(&rte->addr)) {
zlog_warn(
- "Destination prefix is a multicast address %s/%d [%d]",
- inet6_ntoa(rte->addr), rte->prefixlen,
- rte->metric);
+ "Destination prefix is a multicast address %pI6/%d [%d]",
+ &rte->addr, rte->prefixlen, rte->metric);
ripng_peer_bad_route(ripng, from);
continue;
}
if (IN6_IS_ADDR_LINKLOCAL(&rte->addr)) {
zlog_warn(
- "Destination prefix is a link-local address %s/%d [%d]",
- inet6_ntoa(rte->addr), rte->prefixlen,
- rte->metric);
+ "Destination prefix is a link-local address %pI6/%d [%d]",
+ &rte->addr, rte->prefixlen, rte->metric);
ripng_peer_bad_route(ripng, from);
continue;
}
if (IN6_IS_ADDR_LOOPBACK(&rte->addr)) {
zlog_warn(
- "Destination prefix is a loopback address %s/%d [%d]",
- inet6_ntoa(rte->addr), rte->prefixlen,
- rte->metric);
+ "Destination prefix is a loopback address %pI6/%d [%d]",
+ &rte->addr, rte->prefixlen, rte->metric);
ripng_peer_bad_route(ripng, from);
continue;
}
/* - is the prefix length valid (i.e., between 0 and 128,
inclusive) */
if (rte->prefixlen > 128) {
- zlog_warn("Invalid prefix length %s/%d from %s%%%s",
- inet6_ntoa(rte->addr), rte->prefixlen,
- inet6_ntoa(from->sin6_addr), ifp->name);
+ zlog_warn("Invalid prefix length %pI6/%d from %pI6%%%s",
+ &rte->addr, rte->prefixlen,
+ &from->sin6_addr, ifp->name);
ripng_peer_bad_route(ripng, from);
continue;
}
/* - is the metric valid (i.e., between 1 and 16, inclusive) */
if (!(rte->metric >= 1 && rte->metric <= 16)) {
- zlog_warn("Invalid metric %d from %s%%%s", rte->metric,
- inet6_ntoa(from->sin6_addr), ifp->name);
+ zlog_warn("Invalid metric %d from %pI6%%%s",
+ rte->metric, &from->sin6_addr, ifp->name);
ripng_peer_bad_route(ripng, from);
continue;
}
/* Check RTE boundary. RTE size (Packet length - RIPng header size
(4)) must be multiple size of one RTE size (20). */
if (((len - 4) % 20) != 0) {
- zlog_warn("RIPng invalid packet size %d from %s (VRF %s)", len,
- inet6_ntoa(from.sin6_addr), ripng->vrf_name);
+ zlog_warn("RIPng invalid packet size %d from %pI6 (VRF %s)",
+ len, &from.sin6_addr, ripng->vrf_name);
ripng_peer_bad_packet(ripng, &from);
return 0;
}
/* RIPng packet received. */
if (IS_RIPNG_DEBUG_EVENT)
zlog_debug(
- "RIPng packet received from %s port %d on %s (VRF %s)",
- inet6_ntoa(from.sin6_addr), ntohs(from.sin6_port),
+ "RIPng packet received from %pI6 port %d on %s (VRF %s)",
+ &from.sin6_addr, ntohs(from.sin6_port),
ifp ? ifp->name : "unknown", ripng->vrf_name);
/* Logging before packet checking. */
if (IS_RIPNG_DEBUG_EVENT) {
if (to)
- zlog_debug("RIPng update routes to neighbor %s",
- inet6_ntoa(to->sin6_addr));
+ zlog_debug("RIPng update routes to neighbor %pI6",
+ &to->sin6_addr);
else
zlog_debug("RIPng update routes on interface %s",
ifp->name);
#endif /* DEBUG */
vty_out(vty, "\n");
vty_out(vty, "%*s", 18, " ");
- len = vty_out(vty, "%s",
- inet6_ntoa(rinfo->nexthop));
+ len = vty_out(vty, "%pI6",
+ &rinfo->nexthop);
len = 28 - len;
if (len > 0)