gstreamer/subprojects
Jonas K Danielsson 20e3454c26 udpsrc: Disable allocated port reuse for unicast
The `reuse` property end up setting the SO_REUSEADDR socket option for
the UDP socket. This setting have surprising effects.

On Linux systems the man page (`socket(7)`) states:
```
SO_REUSEADDR
    Indicates that the rules used in validating addresses supplied
    in a bind(2) call should allow reuse of local addresses. For
    AF_INET sockets this means that a socket may bind, except when
    there is an active listening socket bound to the address.
```

But since UDP does not listen this ends up meaning that when an
ephemeral port is allocated (setting the `port` to `0`) the kernel is
free to reuse any other UDP port that has `SO_REUSEADDR` set.

Tests checking the likelyhood of port conflict when using multiple
`udpsrc` shows port conflicts starting to occur after ~100-300 udpsrc
with port allocation enabled. See issue #3411 for more details.

Changing the default value of a property is not a small thing we risk
breaking application that rely on the current default value. But since
the effects of having `reuse` default `TRUE` on can also have damaging
and hard-to-debug consequences, it might be worth to consider.

Having `SO_REUSEADDR` enabled for multicast, might have some use cases
but for unicast, with dynamic port allocation, it does not make sense.

When not using an multicast address we will disable port reuse if the
`port` property is set to 0 (=allocate) and warn the user that we did
so.

Closes #3411

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7841>
2024-11-06 10:21:14 +00:00
..
gst-devtools meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
gst-docs android: Port over to the CMake Cerbero SDK module 2024-11-01 14:44:53 +00:00
gst-editing-services meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
gst-examples Revert "gst-examples: update to gradle 8.3" 2024-10-31 04:03:55 +05:30
gst-integration-testsuites validate: Ignore flaky dash playbin3 issue 2024-10-24 19:49:04 +00:00
gst-libav avcodecmap: Use avcodec_get_supported_config() instead of struct fields 2024-11-05 11:34:33 +00:00
gst-plugins-bad meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
gst-plugins-base video-converter: Set TIME segment format on appsrc 2024-11-06 19:30:11 +11:00
gst-plugins-good udpsrc: Disable allocated port reuse for unicast 2024-11-06 10:21:14 +00:00
gst-plugins-ugly meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
gst-python meson: Remove c_std=gnu99 in validate and python 2024-10-29 13:58:09 +00:00
gst-rtsp-server meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
gstreamer gstreamer: update translations 2024-11-03 17:45:28 +00:00
gstreamer-sharp Back to development 2024-03-05 12:58:57 +00:00
gstreamer-vaapi meson: bail out earlier in docs subdir if docs are disabled 2024-11-04 19:14:10 +00:00
macos-bison-binary
packagefiles cairo.wrap: Fix the build with latest MSYS2 2024-10-17 22:39:46 +00:00
webview2 subprojects: webview2: Fix warning with meson 1.4.0 2024-04-13 14:47:29 +00:00
win-flex-bison-binaries
win-nasm
win-pkgconfig
avtp.wrap
cairo.wrap cairo.wrap: Fix the build with latest MSYS2 2024-10-17 22:39:46 +00:00
dav1d.wrap meson: Declare dav1d dependency in subproject 2024-03-25 10:14:13 +00:00
DirectX-Headers.wrap subprojects: Add DirectX-Headers wrap 2023-12-14 18:08:00 +09:00
directxmath.wrap subprojects: directxmath: Update to 3.1.9 2024-04-02 05:14:53 +09:00
dssim.wrap
dv.wrap
expat.wrap
fdk-aac.wrap
FFmpeg.wrap meson: Make wrap downloads smaller 2024-03-23 13:08:15 +00:00
flac.wrap flac: Add wrap file and add fallback for it to the flac plugin 2024-04-07 11:12:51 +00:00
fontconfig.wrap
freetype2.wrap
fribidi.wrap
gdk-pixbuf.wrap ci: Add a gdk-pixbuf file-based wrap for gtk4 2024-10-24 15:52:15 +05:30
gl-headers.wrap
glib-networking.wrap subprojects: update glib-networking wrap to 2.78.1 2024-04-03 18:49:08 +00:00
glib.wrap subprojects: update glib wrap to 2.82.2 2024-10-26 14:33:11 +03:00
gobject-introspection.wrap
graphene.wrap
gst-plugins-rs.wrap Back to development 2024-03-05 12:58:57 +00:00
gtk-sharp.wrap csharp: update gtk-sharp subproject 2023-12-07 17:34:30 +01:00
gtk.wrap meson: Bump gtk4 and pango wraps 2024-08-17 15:00:11 +05:30
harfbuzz.wrap
json-glib.wrap
lame.wrap
libdrm.wrap libdrm.wrap: Bump to latest 2.4.120 2024-05-29 15:49:45 +00:00
libffi.wrap
libgudev.wrap wraps: libgudev: add fallback uri 2024-07-24 11:44:28 +00:00
libjpeg-turbo.wrap
liblc3.wrap subprojects: update liblc3 wrap to 1.1.1 2024-06-28 13:38:36 +01:00
libmicrodns.wrap
libnice.wrap webrtc: Change requirement to libnice 0.1.22 2024-03-22 08:49:32 +00:00
libopenjp2.wrap meson: Update openjpeg wrap to 2.5.2, fixes a warning 2024-09-10 14:59:36 +00:00
libpng.wrap
libpsl.wrap
libsoup.wrap subprojects: Fix libsoup build on windows with gcc14 2024-08-14 04:34:28 +00:00
libsrtp2.wrap
libva.wrap meson: Fix libva.wrap meson build 2024-06-13 04:48:56 +00:00
libwpe.wrap
libxml2.wrap
ntv2.wrap ntv2: Update to AJA NTV2 SDK 17.1.0 2024-09-27 16:43:37 +00:00
ogg.wrap
openh264.wrap subprojects: update openh264 to 2.4.1 2024-09-08 15:31:27 +00:00
opus.wrap subprojects: bump opus wrap to 1.5.2 2024-06-22 12:26:22 +01:00
orc.wrap subprojects: track orc main branch again 2024-03-05 13:25:19 +00:00
pango.wrap meson: Bump gtk4 and pango wraps 2024-08-17 15:00:11 +05:30
pcre2.wrap
pixman.wrap meson: Bump pixman.wrap to latest version 2024-03-23 13:08:15 +00:00
proxy-libintl.wrap
pycairo.wrap
pygobject.wrap
soundtouch.wrap pitch: add validate tests 2024-05-02 13:26:09 +02:00
sqlite3.wrap
vorbis.wrap
vpx.wrap subprojects: bump libvpx wrap to 1.14 2024-08-14 04:34:27 +00:00
wayland-protocols.wrap gstwayland: Support wp_single_pixel_buffer_v1 2024-01-22 16:51:36 -05:00
webrtc-audio-processing.wrap
wpebackend-fdo.wrap
x264.wrap meson: Make wrap downloads smaller 2024-03-23 13:08:15 +00:00
zlib.wrap