[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #37068] netif up/down handling is unclear
From: |
Nirav |
Subject: |
[lwip-devel] [bug #37068] netif up/down handling is unclear |
Date: |
Thu, 23 Jun 2016 12:27:08 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36 |
Follow-up Comment #9, bug #37068 (project lwip):
I think I may have found an incorrect behavior/regression in inbuilt DHCP
Client of lwip. I think it was introduced When the bug #37068 was fixed. I see
that the status callback notifying netif driver that the DHCP is complete gets
triggered before dhcp_bind is complete.
IIUC, before commit id 4e520cdd3009cf2e04c50c173737b379ff7d72a2 the status
callback would trigger only after dhcp_bind was complete. Below is the
detailed flow to elaborate it further.
Earlier LWIP : 1.4.0
DHCPclient Flow was as follows:
1. Netif driver registers a callback using
netif_set_status_callback
2. Netif driver starts DHCP Client by calling netifapi_dhcp_start
It used to call dhcp_start in src/core/dhcp.c
3. DHCP client's state machine execution starts
When the state is reached to DHCP_BOUND
netif was set up by calling netifapi_netif_set_up
4. This would call the callback registered in step 1
5. In callback,netif flags are checked
Check for NETIF_FLAG_DHCP and this helps to find out
that a DHCP address has been gained by the client for the interface
With new LWIP code:
1. Setup of interface has become a must before calling DHCP start
2. Code sequence
netifapi_netif_set_up
netif_set_status_callback
netifapi_dhcp_start
3. DHCP state machine executes and after dhcp_discover is executed, the
registered callback is called.
This happens immediately after an IP address is received by the netif.
4. Callback cannot use flag NETIF_FLAG_DHCP as it is not available now
5. dhcp_supplied_address is used to check if address is supplied using HCP
This code checks for DHCP client state and it should be
DHCP_STATE_BOUND
6. But it appears that before dhcp_bind is done and state is changed, callback
is called.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?37068>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lwip-devel] [bug #37068] netif up/down handling is unclear,
Nirav <=