#include "zclient.h"
#include "lib_errors.h"
-#include "zebra_memory.h"
#include "zebra/interface.h"
#include "zebra/rtadv.h"
#include "zebra/rib.h"
struct zebra_if *zi;
struct irdp_interface *irdp;
uint16_t saved_chksum;
+ char buf[PREFIX_STRLEN];
zi = ifp->info;
if (!zi)
if (iplen < ICMP_MINLEN) {
flog_err(EC_ZEBRA_IRDP_LEN_MISMATCH,
- "IRDP: RX ICMP packet too short from %s\n",
- inet_ntoa(src));
+ "IRDP: RX ICMP packet too short from %pI4",
+ &src);
return;
}
len of IP-header) 14+20 */
if (iplen > IRDP_RX_BUF - 34) {
flog_err(EC_ZEBRA_IRDP_LEN_MISMATCH,
- "IRDP: RX ICMP packet too long from %s\n",
- inet_ntoa(src));
+ "IRDP: RX ICMP packet too long from %pI4",
+ &src);
return;
}
if (in_cksum(icmp, datalen) != saved_chksum) {
flog_warn(
EC_ZEBRA_IRDP_BAD_CHECKSUM,
- "IRDP: RX ICMP packet from %s. Bad checksum, silently ignored",
- inet_ntoa(src));
+ "IRDP: RX ICMP packet from %pI4 Bad checksum, silently ignored",
+ &src);
return;
}
if (icmp->code != 0) {
flog_warn(
EC_ZEBRA_IRDP_BAD_TYPE_CODE,
- "IRDP: RX packet type %d from %s. Bad ICMP type code, silently ignored",
- icmp->type, inet_ntoa(src));
+ "IRDP: RX packet type %d from %pI4 Bad ICMP type code, silently ignored",
+ icmp->type, &src);
return;
}
&& !(irdp->flags & IF_BROADCAST))) {
flog_warn(
EC_ZEBRA_IRDP_BAD_RX_FLAGS,
- "IRDP: RX illegal from %s to %s while %s operates in %s; Please correct settings\n",
- inet_ntoa(src),
+ "IRDP: RX illegal from %pI4 to %s while %s operates in %s; Please correct settings",
+ &src,
ntohl(ip->ip_dst.s_addr) == INADDR_ALLRTRS_GROUP
? "multicast"
- : inet_ntoa(ip->ip_dst),
+ : inet_ntop(AF_INET, &ip->ip_dst,
+ buf, sizeof(buf)),
ifp->name,
irdp->flags & IF_BROADCAST ? "broadcast" : "multicast");
return;
case ICMP_ROUTERSOLICIT:
if (irdp->flags & IF_DEBUG_MESSAGES)
- zlog_debug("IRDP: RX Solicit on %s from %s",
- ifp->name, inet_ntoa(src));
+ zlog_debug("IRDP: RX Solicit on %s from %pI4",
+ ifp->name, &src);
process_solicit(ifp);
break;
default:
flog_warn(
EC_ZEBRA_IRDP_BAD_TYPE_CODE,
- "IRDP: RX packet type %d from %s. Bad ICMP type code, silently ignored",
- icmp->type, inet_ntoa(src));
+ "IRDP: RX packet type %d from %pI4 Bad ICMP type code, silently ignored",
+ icmp->type, &src);
}
}
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = (void *)adata;
- msg.msg_controllen = sizeof adata;
+ msg.msg_controllen = sizeof(adata);
iov.iov_base = buf;
iov.iov_len = size;