[bug #56814] Multicast socket blocks other UDP sockets

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[bug #56814] Multicast socket blocks other UDP sockets

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/bugs/?56814>

                 Summary: Multicast socket blocks other UDP sockets
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: dapaulid
            Submitted on: Tue 27 Aug 2019 10:43:16 AM CEST
                Category: UDP
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

We came across an issue where an UDP socket that joined a multicast group led
to blocking recv() calls on other sockets, given that some datagrams were sent
to the multicast socket but not yet received by the application.

In our case, the effect was that the whole UDP communication to our embedded
device was down, because a single thread was blocked so that it could not
consume the multicast datagrams.

The setup is as follows:

LWIP application (server):

- socket1 bound to 5000
- socket2 bound to 5001 and joined multicast group 224.0.0.22
- while (1):
  - receive datagram on socket1 and send it back (echo)
  - do nothing with socket2 (do not receive multicast data)

PC application (client):

- while (1):
  - send multicast to 5001
  - send and receive datagram from 5000 (echo)
=> will timeout in the second iteration because no echo received.

See attached code to reproduce the issue.

Remarks:
- It seems that all UDP sockets are affected, but not TCP sockets.
- When the client uses the unicast IP instead of 224.0.0.22 to send data to
5001, the problem does not occur.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Tue 27 Aug 2019 10:43:16 AM CEST  Name: mcastblock_receiver.c  Size:
2KiB   By: dapaulid

<http://savannah.nongnu.org/bugs/download.php?file_id=47395>
-------------------------------------------------------
Date: Tue 27 Aug 2019 10:43:16 AM CEST  Name: mcastblock_sender.py  Size: 703B
  By: dapaulid

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

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56814>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel