From: jan Date: Tue, 9 Jul 2024 18:49:05 +0000 (+0000) Subject: vmd(8): Avoid double DHCP reply when using the internal dhcp server. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=82ace5fe53fcf916787993200dc1cb00bceef1dc;p=openbsd vmd(8): Avoid double DHCP reply when using the internal dhcp server. DHCP request should no leave vmd if its answered internally. ok dv@ --- diff --git a/usr.sbin/vmd/vionet.c b/usr.sbin/vmd/vionet.c index f4bb1a9dc68..4e4e2d98b81 100644 --- a/usr.sbin/vmd/vionet.c +++ b/usr.sbin/vmd/vionet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vionet.c,v 1.14 2024/02/22 02:38:53 dv Exp $ */ +/* $OpenBSD: vionet.c,v 1.15 2024/07/09 18:49:05 jan Exp $ */ /* * Copyright (c) 2023 Dave Voutila @@ -839,9 +839,11 @@ vionet_tx(struct virtio_dev *dev) if (vionet->local) { dhcpsz = dhcp_request(dev, iov->iov_base, iov->iov_len, &dhcppkt); - if (dhcpsz > 0) + if (dhcpsz > 0) { log_debug("%s: detected dhcp request of %zu bytes", - __func__, dhcpsz); + __func__, dhcpsz); + goto drop; + } } /* Write our packet to the tap(4). */