Hello Everyone,

 I am trying to port lwip to our research operating system. Everything has
gone well so far except when I am trying to assign ip to my interface using
dhcp. This does not happen always but pretty often: lwip fails at following
assertion in dhcp.c: 1662 (I am using lwip 1.4.1):
  LWIP_ASSERT("dhcp_create_msg: dhcp->p_out == NULL", dhcp->p_out == NULL);

using some outputs I realized this happens because dhcp_create_msg being
called consecutively without a dhcp_delete_msg in between. For example I
had the following pattern:
dhcp_create_msg
dhcp_delete_msg
dhcp_create_msg
***dhcp_create_msg***
where * is when the assertion fails. I don't know the lwip mechanics but I
am guessing sometimes the dhcp_delete_message takes longer than usual I
guess...
I have attached a log file as well. Please let me know what do you think
about this or if you need more information.

Thanks,
-- 
Behrooz
netif: IP address of interface àÿ set to 0.0.0.0
dhcp_coarse_tmr()
netif: netmask of interface àÿ set to 0.0.0.0
dhcp_coarse_tmr()
netif: GW address of interface àÿ set to 0.0.0.0
dhcp_coarse_tmr()
dhcp_coarse_tmr()
netif: added interface en IP addr dhcp_coarse_tmr()
0.0.0.0 netmask dhcp_coarse_tmr()
0.0.0.0 gw 0.0.0.0dhcp_coarse_tmr()

dhcp_coarse_tmr()
netif: setting default interface en
dhcp_coarse_tmr()
dhcp_coarse_tmr()
dhcp_coarse_tmr()
dhcp_start(netif=0xfffffeffffe06220) en0
dhcp_coarse_tmr()
dhcp_start(): starting new DHCP client
dhcp_coarse_tmr()
dhcp_start(): allocated dhcpdhcp_coarse_tmr()
dhcp_start(): starting DHCP configuration
dhcp_coarse_tmr()
dhcp_discover()
dhcp_coarse_tmr()
transaction id xid(abcd0001)
dhcp_coarse_tmr()
dhcp_coarse_tmr()
dhcp_discover: making request
dhcp_coarse_tmr()
dhcp_discover: realloc()ing
dhcp_coarse_tmr()
dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)
dhcp_coarse_tmr()
dhcp_coarse_tmr()
ip_output_if: en0
dhcp_coarse_tmr()
IP header:
dhcp_coarse_tmr()
+-------------------------------+
| 4 | 5 |  0x00 |       336     | (v, hl, tos, len)
+-------------------------------+
|        0      |000|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0xba9d     | (ttl, proto, chksum)
+-------------------------------+
|    0  |    0  |    0  |    0  | (src)
+-------------------------------+
|  255  |  255  |  255  |  255  | (dest)
+-------------------------------+
dhcp_coarse_tmr()
netif->output()dhcp_coarse_tmr()
dhcp_discover: deleting()ing
dhcp_coarse_tmr()
dhcp_discover: SELECTING
dhcp_coarse_tmr()
dhcp_discover(): set request timeout 2000 msecs
dhcp_fine_tmr(): request timeout
dhcp_timeout()
dhcp_timeout(): restarting discovery
dhcp_discover()
transaction id xid(abcd0001)
dhcp_discover: making request
dhcp_discover: realloc()ing
dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)
ip_output_if: en0
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |       336     | (v, hl, tos, len)
+-------------------------------+
|        1      |000|       0   | (id, flags, offset)
+-------------------------------+
|  255  |   17  |    0xba9c     | (ttl, proto, chksum)
+-------------------------------+
|    0  |    0  |    0  |    0  | (src)
+-------------------------------+
|  255  |  255  |  255  |  255  | (dest)
+-------------------------------+
netif->output()dhcp_discover: deleting()ing
dhcp_discover: SELECTING
ip_input: iphdr->dest 0xffffffff netif->ip_addr 0x0 (0x0, 0x0, 0xffffffff)
dhcp_discover(): set request timeout 4000 msecs
ip_input: UDP packet to DHCP client port 68
dhcp_fine_tmr(): request timeout
ip_input: DHCP packet accepted.
dhcp_timeout()
ip_input: 
dhcp_timeout(): restarting discovery
IP header:
dhcp_discover()
+-------------------------------+
transaction id xid(abcd0001)
| 4 | 5 |  0x10 |       576     | (v, hl, tos, len)
dhcp_discover: making request
+-------------------------------+
dhcp_discover: realloc()ing
|        1      |000|       0   | (id, flags, offset)
dhcp_discover: sendto(DISCOVER, IP_ADDR_BROADCAST, DHCP_SERVER_PORT)
+-------------------------------+
ip_output_if: en0
|   64  |   17  |    0x6c9b     | (ttl, proto, chksum)
IP header:
+-------------------------------+
+-------------------------------+
|   10  |    0  |    2  |    2  | (src)
| 4 | 5 |  0x00 |       336     | (v, hl, tos, len)
+-------------------------------+
+-------------------------------+
|  255  |  255  |  255  |  255  | (dest)
|        2      |000|       0   | (id, flags, offset)
+-------------------------------+
+-------------------------------+
ip_input: p->len 576 p->tot_len 576
|  255  |   17  |    0xba9b     | (ttl, proto, chksum)
dhcp_recv(pbuf = 0xffffffff8041d9fa) from DHCP server 10.0.2.2 port 67
+-------------------------------+
pbuf->len = 548
|    0  |    0  |    0  |    0  | (src)
pbuf->tot_len = 548
+-------------------------------+
|  255  |  255  |  255  |  255  | (dest)
searching DHCP_OPTION_MESSAGE_TYPE
+-------------------------------+
DHCP_OFFER received in DHCP_SELECTING state
netif->output()dhcp_handle_offer(netif=0xfffffeffffe06220) en0
dhcp_discover: deleting()ing
dhcp_handle_offer(): server 0x0202000a
dhcp_discover: SELECTING
dhcp_handle_offer(): offer for 0x0f02000a
dhcp_discover(): set request timeout 8000 msecs
dhcp_select(netif=0xfffffeffffe06220) en0
dhcp_fine_tmr(): request timeout
transaction id xid(abcd0002)
dhcp_timeout()
dhcp_timeout(): REQUESTING, DHCP request timed out
ip_output_if: en0
dhcp_select(netif=0xfffffeffffe06220) en0
IP header:
+-------------------------------+
ABORT  :  in kos/glue/AssertGlue.cc:12 in LWIPABORT - | 4 | 5 |  0x00 |       336     | (v, hl, tos, len)
dhcp_create_msg: dhcp->p_out == NULL
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to