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

Alexandre Janniaux ajanni at videolabs.io
Fri Feb 7 13:33:07 CET 2020


Hi,

LGTM for the patch,

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Feb 06, 2020 at 08:01:44PM +0200, RĂ©mi Denis-Courmont wrote:
> 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
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list