[vlc-commits] udp: do not set SO_REUSEPORT on Linux (refs #23201)

Rémi Denis-Courmont git at videolan.org
Sat Feb 8 16:45:49 CET 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Feb  6 19:57:23 2020 +0200| [b90d8bb2728d1fcabe1bc1623749864832e33839] | committer: Rémi Denis-Courmont

udp: do not set SO_REUSEPORT on Linux (refs #23201)

VLC set the SO_REUSEPORT socket option on BSD so that multiple UDP
sockets can receive multicast packets on the same port. On Linux,
that behaviour is covered by SO_REUSEADDR.

In "recent" times, Linux added a SO_REUSEPORT option that does
something else - enable load-balancing, which is not the intended
behaviour.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b90d8bb2728d1fcabe1bc1623749864832e33839
---

 src/network/udp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network/udp.c b/src/network/udp.c
index d90871c91e..d7c602a3b6 100644
--- a/src/network/udp.c
+++ b/src/network/udp.c
@@ -90,7 +90,7 @@
 static int net_SetupDgramSocket (vlc_object_t *p_obj, int fd,
                                  const struct addrinfo *ptr)
 {
-#ifdef SO_REUSEPORT
+#if defined (SO_REUSEPORT) && !defined (__linux__)
     setsockopt (fd, SOL_SOCKET, SO_REUSEPORT, &(int){ 1 }, sizeof (int));
 #endif
 



More information about the vlc-commits mailing list