summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/bpf.c
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2018-12-08 23:06:41 +0000
committerkrw <krw@openbsd.org>2018-12-08 23:06:41 +0000
commit712955bd65292f8c68b7435d3d0c9354bf66d1d8 (patch)
tree9c8480d977d242127d79ba1dbd8bc4c0eb029e22 /sbin/dhclient/bpf.c
parentFix kill [-SIGNAME | -s SIGNAME] and simplify (diff)
downloadwireguard-openbsd-712955bd65292f8c68b7435d3d0c9354bf66d1d8.tar.xz
wireguard-openbsd-712955bd65292f8c68b7435d3d0c9354bf66d1d8.zip
ssize_t and unsigned int may be different sizes. Use ssize_t instead
of unsigned int for value being compared to the results of writev() and sendmsg() calls. Noticed by naddy@ on i386 compile.
Diffstat (limited to 'sbin/dhclient/bpf.c')
-rw-r--r--sbin/dhclient/bpf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 0bf8a6f1c2f..01c9f48222b 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.70 2018/07/04 08:37:10 mpi Exp $ */
+/* $OpenBSD: bpf.c,v 1.71 2018/12/08 23:06:41 krw Exp $ */
/* BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -249,8 +249,8 @@ send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to,
struct udphdr udp;
struct msghdr msg;
struct dhcp_packet *packet = &ifi->sent_packet;
- ssize_t result;
- unsigned int iovcnt = 0, i, total;
+ ssize_t result, total;
+ unsigned int iovcnt = 0, i;
int len = ifi->sent_packet_length;
memset(&dest, 0, sizeof(dest));
@@ -307,7 +307,7 @@ send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to,
if (result == -1)
log_warn("%s: writev(%s)", log_procname, desc);
else if (result < total) {
- log_warnx("%s, writev(%s): %zd of %u bytes",
+ log_warnx("%s, writev(%s): %zd of %zd bytes",
log_procname, desc, result, total);
result = -1;
}
@@ -322,7 +322,7 @@ send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to,
log_warn("%s: sendmsg(%s)", log_procname, desc);
else if (result < total) {
result = -1;
- log_warnx("%s, sendmsg(%s): %zd of %u bytes",
+ log_warnx("%s, sendmsg(%s): %zd of %zd bytes",
log_procname, desc, result, total);
}
}