espenc
espenc copied to clipboard
Think I unterstand why STA netif must be up
Looking into the lwip code, I think, I understand why this fails, when the STA netif is not up:
in lwip/core/ipv4/ip.c, lines 138 ff.:
/* iterate through netifs */
for(netif = netif_list; netif != NULL; netif = netif->next) {
/* network mask matches? */
if (netif_is_up(netif)) {
if (!ip_addr_isbroadcast(dest, netif) && netif == (struct netif *)eagle_lwip_getif(0)) {
return netif;
}
}
}
the STA interface is hardcoded as default netif. Setting a different netif as default_netif should help. Probably it might be a good idea to remove this here and use a properly end explicitly defined default_netif all the time.