[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #46185] UDP packets are not received after socket rebi
From: |
Andreas Toensfeuerborn |
Subject: |
[lwip-devel] [bug #46185] UDP packets are not received after socket rebind |
Date: |
Mon, 12 Oct 2015 06:43:50 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0 |
URL:
<http://savannah.nongnu.org/bugs/?46185>
Summary: UDP packets are not received after socket rebind
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: atoensfeuerborn
Submitted on: Mon 12 Oct 2015 06:43:48 AM GMT
Category: UDP
Severity: 3 - Normal
Item Group: Faulty Behaviour
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release:
lwIP version: 1.4.1
_______________________________________________________
Details:
In my application I use several interfaces (up to 32). The behaviour described
below can be reproduced easier with more than 1 interface but occurs also with
only 1 interface.
After startup, I create 2 UDP sockets for each interface but do not bind them
because I do not know the IP address yet.
For each socket I have a separate receive thread calling "lwip_recvfrom". The
function returns an error because the socket is not bound and I ignore the
error.
At some point the sockets are bound to an IP address by calling
- lwip_close()
- lwip_socket()
- lwip_bind()
I have been using this kind of implementation with native sockets from
Windows, Linux and VxWorks without any problems.
Most of the time the behaviour after that is correct and packets are received
properly in the receive thread(s).
But sporadically received packets are not delivered to "lwip_recfrom".
The packet is transferred through functions "udp_input" to "recv_udp" but the
mailbox does not deliver the packet to "netconn_recv_data" and therefore to
"lwip_recfrom".
The behaviour is the same under Linux and Windows so I think the mailbox
handling itself is not the source of the problem.
The error seems to occur in case the function "sys_mbox_trypost" is called
before the function "lwip_recvfrom" (netconn_recv_data) is ready to receive
the data.
I have attached to files with (also self made) debug outputs in case the
connection is ok and not ok.
In case the connection is ok, "lwip_recvfrom" is called before "udp_input"
after the rebind.
In case the connection is not ok, "udp_input" is called before
"lwip_recvfrom".
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Mon 12 Oct 2015 06:43:48 AM GMT Name: putty_ok.TXT Size: 181kB By:
atoensfeuerborn
<http://savannah.nongnu.org/bugs/download.php?file_id=35162>
-------------------------------------------------------
Date: Mon 12 Oct 2015 06:43:48 AM GMT Name: putty_nok.TXT Size: 317kB By:
atoensfeuerborn
<http://savannah.nongnu.org/bugs/download.php?file_id=35163>
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/bugs/?46185>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [bug #46185] UDP packets are not received after socket rebind,
Andreas Toensfeuerborn <=