[vlc-devel] [PATCH] udp: do not set SO_REUSEPORT on Linux (refs #23201)
RĂ©mi Denis-Courmont
remi at remlab.net
Thu Feb 6 19:01:44 CET 2020
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.
---
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
--
2.25.0
More information about the vlc-devel
mailing list