lwip-devel
[Top][All Lists]
Advanced

[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: Mon, 23 Nov 2015 22:32:51 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?46506>

                 Summary: nd6_new_router() should check if router exists in
router list first
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: zsmith
            Submitted on: Mon 23 Nov 2015 10:32:50 PM GMT
                Category: IPv6
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: git head

    _______________________________________________________

Details:

I think that nd6_new_router() should possibly check the default_router_list[]
to see if the router already exists in the list before adding it. It first
checks if there is a neighbor_cache[] entry for the router address passed in.
If not, it creates one. Then it marks it as a router and adds an entry to the
default_router_list[] (w/o checking if it is already there).

We experienced a problem in our (potentially unique) use case where we have 2
netifs (Ethernet & Wi-Fi) that are on the same network. The same router was
discovered on both netifs. It was first discovered on Ethernet and it was
added to the router list. Then when discovered again on the Wi-Fi netif
(received a Router Advertisement) it was interesting what happened:

In nd6_input(), in the router advertisement case (ICMP6_TYPE_RA),
nd6_get_router() is called to check to see if the router already exists - but
this function checks against the netif. Since the netif is different, this
function returns none found. So nd6_new_router() is called. A new
neighbor_cache[] entry is not created since it already exists (with the *Eth
netif*), and another entry is added in the default_router_list[] that points
to that neighbor_entry again. So, the new router entry is a duplicate of what
is already there - the entry with the *Eth netif.*

The process repeats every time a Router Advertisement is received and the
default_router_list[] fills up with duplicate entries.

Because of the nd6_get_router() check that is done when RA is received this
problem is avoided in the more usual case that the same router is not
discovered on more than one netif.

I included a patch with a potential fix for this. This patch just adds a check
in nd6_new_router() to check that the router is not already in the list before
adding it again.

Thanks 



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 23 Nov 2015 10:32:50 PM GMT  Name: nd6_new_router_check_exists.patch
 Size: 952B   By: zsmith

<http://savannah.nongnu.org/bugs/download.php?file_id=35533>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?46506>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]