lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #46524] Device as dhcp server does not work after upgr


From: Axel Lin
Subject: [lwip-devel] [bug #46524] Device as dhcp server does not work after upgrade to lwip-1.4.1
Date: Wed, 25 Nov 2015 06:48:36 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36

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

                 Summary: Device as dhcp server does not work after upgrade to
lwip-1.4.1
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: axellin
            Submitted on: Wed 25 Nov 2015 06:48:35 AM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: 1.4.1

    _______________________________________________________

Details:

hi,
My device's dhcp server does not work after upgrade from lwip-1.4.0rc1 to
lwip-1.4.1.

In my case, the device is running as an AP and dhcp server.
So I use PC to connect this device and do some configuration.
After upgrading to lwip-1.4.1, the PC can associate the AP but fail to
get ip from the dhcp server.

I found the bad commit is:
commit 4849eb4c543ea4ddc9869ee51698d4760d107cb0
Author: Simon Goldschmidt <address@hidden>
Date:   Fri Sep 9 22:25:59 2011 +0200

    fixed bug #34072: UDP broadcast is received from wrong UDP pcb if udp port
matches

Below is my run time variable status:
broadcast is true
ip_addr_isany(&pcb->local_ip) is false
ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(), &inp->netmask) is
false

&pcb->local_ip: 192 .168 .10 .1
ip_current_dest_addr(): 255 .255 .255 .255
&inp->netmask: 255 .255 .255 .0

It works if I did below changes:

diff --git a/src/core/udp.c b/src/core/udp.c
index 32c7d38..1c2733b 100644
--- a/src/core/udp.c
+++ b/src/core/udp.c
@@ -246,13 +246,13 @@ udp_input(struct pbuf *p, struct netif *inp)
            ip_addr_ismulticast(&current_iphdr_dest) ||
 #endif /* LWIP_IGMP */
 #if IP_SOF_BROADCAST_RECV
-            (broadcast && ip_get_option(pcb, SOF_BROADCAST) &&
+            (broadcast && ip_get_option(pcb, SOF_BROADCAST) /*&&
              (ip_addr_isany(&pcb->local_ip) ||
-              ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(),
&inp->netmask)))) {
+              ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(),
&inp->netmask))*/)) {
 #else /* IP_SOF_BROADCAST_RECV */
-            (broadcast &&
+            (broadcast /*&&
              (ip_addr_isany(&pcb->local_ip) ||
-              ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(),
&inp->netmask)))) {
+              ip_addr_netcmp(&pcb->local_ip, ip_current_dest_addr(),
&inp->netmask))*/)) {
 #endif /* IP_SOF_BROADCAST_RECV */
           local_match = 1;
           if ((uncon_pcb == NULL) &&





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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