Disable OFFER_Router

sorenhl
Posts: 22
Joined: Sun Jun 03, 2018 9:34 pm

Disable OFFER_Router

Postby sorenhl » Fri Jun 08, 2018 9:39 pm

Hi,

I am trying to port a esp8266 project to ESP32, but i am facing issues with one command:

Code: Select all

uint8 mode = 0;
wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode);
It does so iPhones can still surf the internet while being connected to the AP.

It seems like the functionality is inside "apps/dhcpserver.h", but I cannot really figure out how to use the dhcps_set_option_info.

Any idea how to do this now? I have been trying and failing for hours, so any help would be greatly appreciated.


/Søren

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Disable OFFER_Router

Postby WiFive » Sat Jun 09, 2018 9:47 am

Try

Code: Select all

uint8_t val = 0;
tcpip_adapter_dhcps_option(TCPIP_ADAPTER_OP_SET, ROUTER_SOLICITATION_ADDRESS, &val, sizeof(dhcps_offer_t));

sorenhl
Posts: 22
Joined: Sun Jun 03, 2018 9:34 pm

Re: Disable OFFER_Router

Postby sorenhl » Sat Jun 09, 2018 8:45 pm

The code you posted works perfect, thank you so much!

If anybody else is trying this, remember to stop, apply line, start the dhcp server for it to work :D

phatpaul
Posts: 110
Joined: Fri Aug 24, 2018 1:14 pm

Re: Disable OFFER_Router

Postby phatpaul » Fri Nov 02, 2018 6:17 pm

Elsewhere on the web people say to disable dhcp option 3 and option 6.
https://superuser.com/questions/596053/ ... in-openwrt

But you say to use ROUTER_SOLICITATION_ADDRESS which is option 32.

So is it option 3 or 32?
I'm going to also disable option 3 and 6 just to be sure.

Where is the documentation for this?
I only found:
https://www.esp8266.com/viewtopic.php?t=1798

phatpaul
Posts: 110
Joined: Fri Aug 24, 2018 1:14 pm

Re: Disable OFFER_Router

Postby phatpaul » Fri Nov 02, 2018 7:10 pm

Nevermind, this IDF code is a mess...

It looks like it actually prevents sending ROUTER option 3, even though the API incorrectly uses ROUTER_SOLICITATION_ADDRESS (32) as a flag for that functionality.

But should we not send option 3, or send it with an invalid IP of 0.0.0.0?

Also, by setting
uint8_t opt_val = 0; // don't supply a dns server via dhcps
ESP_ERROR_CHECK(tcpip_adapter_dhcps_option(TCPIP_ADAPTER_OP_SET, TCPIP_ADAPTER_DOMAIN_NAME_SERVER, &opt_val, 1));

It is still sending option 6 - dns server. But it is just sending it's own IP. See
https://github.com/espressif/esp-idf/bl ... ver.c#L344

But shouldn't we be able to prevent sending the option 6 entirely?

Who is online

Users browsing this forum: No registered users and 54 guests