ETHER: Fix NAT dhcp behavior to properly respond to the MAC of the requestor

This commit is contained in:
Mark Pizzolato 2021-12-10 18:17:18 -08:00
parent c5cd38afbf
commit b35d36407d

View file

@ -170,6 +170,7 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp)
rbp = (struct bootp_t *)m->m_data;
m->m_data += sizeof(struct udpiphdr);
memset(rbp, 0, sizeof(struct bootp_t));
daddr.sin_addr.s_addr = 0xffffffffu;
if (dhcp_msg_type == DHCPDISCOVER) {
if (preq_addr.s_addr != htonl(0L)) {
@ -308,8 +309,6 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp)
}
*q = RFC1533_END;
daddr.sin_addr.s_addr = 0xffffffffu;
m->m_len = sizeof(struct bootp_t) -
sizeof(struct ip) - sizeof(struct udphdr);
udp_output2(NULL, m, &saddr, &daddr, IPTOS_LOWDELAY);