From 82ace5fe53fcf916787993200dc1cb00bceef1dc Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 9 Jul 2024 18:49:05 +0000 Subject: [PATCH] vmd(8): Avoid double DHCP reply when using the internal dhcp server. DHCP request should no leave vmd if its answered internally. ok dv@ --- usr.sbin/vmd/vionet.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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). */ -- 2.20.1