This commit is contained in:
Shaw Drastin 2024-09-23 07:26:52 +02:00 committed by GitHub
commit e2bcbca211
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -454,18 +454,13 @@ static u8_t *add_offer_options(dhcps_t *dhcps, u8_t *optptr)
}
}
if (dhcps_dns_enabled(dhcps->dhcps_dns)) {
*optptr++ = DHCP_OPTION_DNS_SERVER;
*optptr++ = 4;
if (dhcps_dns_enabled(dhcps->dhcps_dns)) {
*optptr++ = ip4_addr1(&dhcps->dns_server);
*optptr++ = ip4_addr2(&dhcps->dns_server);
*optptr++ = ip4_addr3(&dhcps->dns_server);
*optptr++ = ip4_addr4(&dhcps->dns_server);
}else {
*optptr++ = ip4_addr1(&ipadd);
*optptr++ = ip4_addr2(&ipadd);
*optptr++ = ip4_addr3(&ipadd);
*optptr++ = ip4_addr4(&ipadd);
}
ip4_addr_t broadcast_addr = { .addr = (ipadd.addr & dhcps->dhcps_mask.addr) | ~dhcps->dhcps_mask.addr };