8000 DHCP custom option by mcspr · Pull Request #8582 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

DHCP custom option #8582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Jun 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
Prev Previous commit
Next Next commit
daisy chain
  • Loading branch information
mcspr committed May 31, 2022
commit 729b732c03885a4e7869aa6ff89394a9d61174cb
10 changes: 5 additions & 5 deletions cores/esp8266/LwipDhcpServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ bool DhcpServer::add_dhcps_lease(uint8* macaddr)
///////////////////////////////////////////////////////////////////////////////////
void DhcpServer::add_offer_options(OptionsBuffer& options)
{
options.add(DHCP_OPTION_SUBNET_MASK, ip_2_ip4(&_netif->netmask));
options.add(DHCP_OPTION_LEASE_TIME, lease_time);
options.add(DHCP_OPTION_SERVER_ID, ip_2_ip4(&_netif->ip_addr));
options.add(DHCP_OPTION_SUBNET_MASK, ip_2_ip4(&_netif->netmask))
.add(DHCP_OPTION_LEASE_TIME, lease_time)
.add(DHCP_OPTION_SERVER_ID, ip_2_ip4(&_netif->ip_addr));

if (offer_router && !ip4_addr_isany_val(*ip_2_ip4(&_netif->gw)))
{
Expand All @@ -352,8 +352,8 @@ void DhcpServer::add_offer_options(OptionsBuffer& options)

#ifdef USE_DNS
options.add(DHCP_OPTION_DNS_SERVER, !ip4_addr_isany_val(*ip_2_ip4(&dns_address))
? ip_2_ip4(&dns_address)
: ip_2_ip4(&_netif->ip_addr));
? ip_2_ip4(&dns_address)
: ip_2_ip4(&_netif->ip_addr));
#endif

{
Expand Down
4 changes: 2 additions & 2 deletions libraries/ESP8266WiFi/examples/CustomOffer/CustomOffer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

void setup() {
dhcpSoftAP.custom_offer_options = [](const DhcpServer&, auto& options) {
options.add(43, { 0xca, 0xfe, 0xca, 0xfe, 0xfe }); // VENDOR is... vendor specific
options.add(114, "https://192.168.4.1"); // Captive portal
options.add(43, { 0xca, 0xfe, 0xca, 0xfe, 0xfe }) // VENDOR is... vendor specific
.add(114, "https://192.168.4.1"); // Captive portal
};
WiFi.softAP("TEST", "testtesttest");
}
Expand Down
0