-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
default interface selected when gateway is valid #54
Conversation
After a second thought, if ((netif_default == NULL || netif_default == netif_ap) && !ip_addr_islinklocal(&netif->ip_addr)) could/should be replaced by checking for non-zero |
why check ip at all though? |
If interface IP address is not routable, then it is useless to define this interface as default one to get to internet. |
Yeah, true. git-grep status_callback shows up in netif_set_{up,down}, but also via netif_set_ipaddr for v4/v6 triggered by something and if it is something valid there's another status_callback call Should it also de-register itself? i.e. not only act when netif is up?
ethernet netif is still manual though, should it also have callback and take priority from sta? |
I understand you agree with where these changes happens.
Yes, I shall update code with your proposal.
Yes ethernet should have the same netif callback. |
Unless forced, the ethernet interface will not be used as default if sta was selected before. |
d-a-v#54 plus formatting, getting lazy
When interface STA was becoming "UP", it was selected as default interface.
Now it is selected as default interface (= the way out for unknown destination address) only when
there is no default interface, or when default interface is AP (cannot be the way out),
and the STA interface address is not private.
This PR is included in esp8266/Arduino#8319
which embeds a similar test for ethernet interfaces.