From b8c3aabe70e8dac5ac6da76a78ebdecfaed47ed4 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 26 Mar 2021 17:40:03 +0000 Subject: [PATCH] inspect all the packets to see if they are dhcp, not just the first one in a ring bundle. ok florian --- usr.sbin/vmd/virtio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/vmd/virtio.c b/usr.sbin/vmd/virtio.c index 8800594fc61..1d269ed65ff 100644 --- a/usr.sbin/vmd/virtio.c +++ b/usr.sbin/vmd/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.82 2019/12/11 06:45:16 pd Exp $ */ +/* $OpenBSD: virtio.c,v 1.83 2021/03/26 17:40:03 deraadt Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -1404,7 +1404,6 @@ vionet_notify_tx(struct vionet_dev *dev) vr = pkt = dhcppkt = NULL; ret = spc = 0; - dhcpsz = 0; vr_sz = vring_size(VIONET_QUEUE_SIZE); q_gpa = dev->vq[TXQ].qa; @@ -1510,7 +1509,7 @@ vionet_notify_tx(struct vionet_dev *dev) log_debug("vionet: wrong source address %s for vm %d", ether_ntoa((struct ether_addr *) eh->ether_shost), dev->vm_id); - else if (dev->local && dhcpsz == 0 && + else if (dev->local && (dhcpsz = dhcp_request(dev, pkt, pktsz, &dhcppkt)) != -1) { log_debug("vionet: dhcp request," " local response size %zd", dhcpsz); -- 2.20.1