[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #46506] nd6_new_router() should check if router exists
From: |
Zach Smith |
Subject: |
[lwip-devel] [bug #46506] nd6_new_router() should check if router exists in router list first |
Date: |
Tue, 15 Mar 2016 22:21:26 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36 |
Follow-up Comment #2, bug #46506 (project lwip):
Thanks for looking at this.
We don't have any great way of dealing with the 2 netifs in the same subnet.
We have just implemented a way to attempt to keep track of which netif packets
from ip X come in on and send responses back on the same netif - I think this
has been done by others. I must admit I don't really know all the problems
that could/would/will arise from having 2 netifs in the same subnet. I would
love to be educated on that.
Anyway, thanks for pointing out that the fix isn't quite right. Good catch. I
see why we need to first iterate the whole router list before the "Look for
empty entry" loop. We were attempting to do it in the same loop, but I see now
that you must take into account that routers can be removed at any time from
any spot in that list. Just because you find a NULL entry doesn't mean that
the router does not already exist further down in the array.
So, instead you'd do this before the "Look for empty" loop:
/* Check if router is already in the list before adding it */
for (router_index = 0; router_index < LWIP_ND6_NUM_ROUTERS; router_index++)
{
if(default_router_list[router_index].neighbor_entry ==
&(neighbor_cache[neighbor_index])){
return router_index;
}
}
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?46506>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/