summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/bpf.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2018-07-04 08:37:10 +0000
committermpi <mpi@openbsd.org>2018-07-04 08:37:10 +0000
commit32fb2ac95c1f20cb6e35196d0d25cbd4ec067adb (patch)
tree7760ed4622281c6f1f9a5457c1c9bd32c9e256c9 /sbin/dhclient/bpf.c
parent"proto" is optional; from matthew martin (diff)
downloadwireguard-openbsd-32fb2ac95c1f20cb6e35196d0d25cbd4ec067adb.tar.xz
wireguard-openbsd-32fb2ac95c1f20cb6e35196d0d25cbd4ec067adb.zip
Print the amount of bytes written, as intended, instead of -1 when
an error occurs. ok krw@
Diffstat (limited to 'sbin/dhclient/bpf.c')
-rw-r--r--sbin/dhclient/bpf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c
index 4416d8f39e9..0bf8a6f1c2f 100644
--- a/sbin/dhclient/bpf.c
+++ b/sbin/dhclient/bpf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.c,v 1.69 2017/09/20 18:28:14 krw Exp $ */
+/* $OpenBSD: bpf.c,v 1.70 2018/07/04 08:37:10 mpi Exp $ */
/* BPF socket interface code, originally contributed by Archie Cobbs. */
@@ -307,9 +307,9 @@ 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) {
- result = -1;
log_warnx("%s, writev(%s): %zd of %u bytes",
log_procname, desc, result, total);
+ result = -1;
}
} else {
memset(&msg, 0, sizeof(msg));