summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd
diff options
context:
space:
mode:
authorDave Voutila <dv@cvs.openbsd.org>2024-02-09 14:52:40 +0000
committerDave Voutila <dv@cvs.openbsd.org>2024-02-09 14:52:40 +0000
commit874ca855a6dd6a2edde39bb85fccbd6da885bc7d (patch)
tree6455e118106917bf5bc0ed72b70bef06cf415b38 /usr.sbin/vmd
parent790d7893ac8924a69a1ea2bf7b741db1c38bad15 (diff)
Only debug log dhcp packet info if packet is found.
No functional change. vmd(8) was being chatty and incorrect.
Diffstat (limited to 'usr.sbin/vmd')
-rw-r--r--usr.sbin/vmd/vionet.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/vmd/vionet.c b/usr.sbin/vmd/vionet.c
index 5ed06fb8a4c..6f4b741bd1f 100644
--- a/usr.sbin/vmd/vionet.c
+++ b/usr.sbin/vmd/vionet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vionet.c,v 1.10 2024/02/05 21:58:09 dv Exp $ */
+/* $OpenBSD: vionet.c,v 1.11 2024/02/09 14:52:39 dv Exp $ */
/*
* Copyright (c) 2023 Dave Voutila <dv@openbsd.org>
@@ -764,8 +764,9 @@ vionet_notify_tx(struct virtio_dev *dev)
if (vionet->local) {
dhcpsz = dhcp_request(dev, iov->iov_base, iov->iov_len,
&dhcppkt);
- log_debug("%s: detected dhcp request of %zu bytes",
- __func__, dhcpsz);
+ if (dhcpsz > 0)
+ log_debug("%s: detected dhcp request of %zu bytes",
+ __func__, dhcpsz);
}
/* Write our packet to the tap(4). */