Blame SOURCES/0001-Fix-DHCP-broken-in-libslirp-v4.6.0.patch
|
|
ab660b |
From c9f314f6e315a5518432761fea864196a290f799 Mon Sep 17 00:00:00 2001
|
|
|
ab660b |
From: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
|
|
ab660b |
Date: Thu, 17 Jun 2021 18:01:32 +0900
|
|
|
ab660b |
Subject: [PATCH] Fix "DHCP broken in libslirp v4.6.0"
|
|
|
ab660b |
|
|
|
ab660b |
Fix issue 48
|
|
|
ab660b |
|
|
|
ab660b |
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
|
|
|
ab660b |
---
|
|
|
ab660b |
src/bootp.c | 4 +++-
|
|
|
ab660b |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
ab660b |
|
|
|
ab660b |
diff --git a/src/bootp.c b/src/bootp.c
|
|
|
ab660b |
index cafa1eb..0a35873 100644
|
|
|
ab660b |
--- a/src/bootp.c
|
|
|
ab660b |
+++ b/src/bootp.c
|
|
|
ab660b |
@@ -359,7 +359,9 @@ static void bootp_reply(Slirp *slirp,
|
|
|
ab660b |
|
|
|
ab660b |
daddr.sin_addr.s_addr = 0xffffffffu;
|
|
|
ab660b |
|
|
|
ab660b |
- m->m_len = sizeof(struct bootp_t) - sizeof(struct ip) - sizeof(struct udphdr);
|
|
|
ab660b |
+ assert ((q - rbp->bp_vend + 1) <= DHCP_OPT_LEN);
|
|
|
ab660b |
+
|
|
|
ab660b |
+ m->m_len = sizeof(struct bootp_t) + (q - rbp->bp_vend + 1) - sizeof(struct ip) - sizeof(struct udphdr);
|
|
|
ab660b |
udp_output(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);
|
|
|
ab660b |
}
|
|
|
ab660b |
|
|
|
ab660b |
--
|
|
|
ab660b |
2.29.0
|
|
|
ab660b |
|