espenc icon indicating copy to clipboard operation
espenc copied to clipboard

Think I unterstand why STA netif must be up

Open martin-ger opened this issue 6 years ago • 0 comments

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.

martin-ger avatar Mar 09 '18 13:03 martin-ger