You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When multiple netifs are on the same local subnet multiple problems arise:
ip_route() is called with only destination IP as parameter. Thus the netif that is found as matching is always the first one on this subnet and not the one where the socket is bound to
when the link goes down on that first netif, the packet is still sent its way and gets lost even though there is a perfectly fine netif on the same subnet ready to take over.
the "default_netif" must match to the interface that has the configured "default gateway" because it is always the last chance netif when no route is found ==> when there are two netifs on the same subnet and the default gateway is on that net, the netif going link down must give its "default status" to the other netif on the same subnet
phew...
I suggest starting with adding "src" to the parameters of ip_route() and choosing the netif also according to the source (if not INADDR_ANY etc.)
we need to include the check for link_down in ip_route() as well so that other interfaces on a matching subnet have a chance to sent the packet. This also means that during the first run of the for loop, the correct netif (matching src ip) might be down so we have to either re-run the for loop, now taking other netifs on that subent into account or find another way to check for another netif on same subnet.
the default_netif must always match the one netif that is a) up+link and b) can reach the default gateway.
The text was updated successfully, but these errors were encountered:
Alternative to adding the "src" to the routing function (which feels odd) we could replace all the places where the function is abused to find out a local IP and/or the fitting netif to send on.
Becuase in those cases, we need to find a good match.
When multiple netifs are on the same local subnet multiple problems arise:
phew...
The text was updated successfully, but these errors were encountered: