cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
6e7d01
From d0c668aa0ad255c3598267816154874541ac2943 Mon Sep 17 00:00:00 2001
6e7d01
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
6e7d01
Date: Thu, 29 Jul 2021 04:56:42 -0400
6e7d01
Subject: [PATCH 12/14] Fix "DHCP broken in libslirp v4.6.0"
6e7d01
MIME-Version: 1.0
6e7d01
Content-Type: text/plain; charset=UTF-8
6e7d01
Content-Transfer-Encoding: 8bit
6e7d01
6e7d01
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
6e7d01
Message-id: <20210708082537.1550263-9-marcandre.lureau@redhat.com>
6e7d01
Patchwork-id: 101824
6e7d01
O-Subject: [RHEL-8.5.0 qemu-kvm PATCH 8/8] Fix "DHCP broken in libslirp v4.6.0"
6e7d01
Bugzilla: 1970819 1970835 1970843 1970853
6e7d01
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
6e7d01
RH-Acked-by: Eric Blake <eblake@redhat.com>
6e7d01
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
6e7d01
6e7d01
From: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
6e7d01
6e7d01
Fix issue 48
6e7d01
6e7d01
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
6e7d01
6e7d01
(cherry picked from commit c9f314f6e315a5518432761fea864196a290f799)
6e7d01
[ minor conflict fix due to indentation change ]
6e7d01
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
6e7d01
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
6e7d01
---
6e7d01
 slirp/src/bootp.c | 12 ++++++------
6e7d01
 1 file changed, 6 insertions(+), 6 deletions(-)
6e7d01
6e7d01
diff --git a/slirp/src/bootp.c b/slirp/src/bootp.c
6e7d01
index 5789187166..3e4af075f1 100644
6e7d01
--- a/slirp/src/bootp.c
6e7d01
+++ b/slirp/src/bootp.c
6e7d01
@@ -354,14 +354,14 @@ static void bootp_reply(Slirp *slirp,
6e7d01
         q += sizeof(nak_msg) - 1;
6e7d01
     }
6e7d01
     assert(q < end);
6e7d01
-    *q =
6e7d01
-RFC1533_END
6e7d01
-;
6e7d01
+    *q = RFC1533_END;
6e7d01
 
6e7d01
-daddr.sin_addr.s_addr = 0xffffffffu;
6e7d01
+    daddr.sin_addr.s_addr = 0xffffffffu;
6e7d01
 
6e7d01
-m->m_len = sizeof(struct bootp_t) - sizeof(struct ip) - sizeof(struct udphdr);
6e7d01
-udp_output(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
6e7d01
+    assert ((q - rbp->bp_vend + 1) <= DHCP_OPT_LEN);
6e7d01
+
6e7d01
+    m->m_len = sizeof(struct bootp_t) + (q - rbp->bp_vend + 1) - sizeof(struct ip) - sizeof(struct udphdr);
6e7d01
+    udp_output(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
6e7d01
 }
6e7d01
 
6e7d01
 void bootp_input(struct mbuf *m)
6e7d01
-- 
6e7d01
2.27.0
6e7d01