yeahuh / rpms / qemu-kvm

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