gstreamer/subprojects/gst-plugins-good/gst
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
..
alpha doc: Fix newline char between authors 2023-05-20 05:48:23 +00:00
apetag gst-plugins-good: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
audiofx gst-plugins-good: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
audioparsers flacparse: fix buffer overflow in gst_flac_parse_frame_is_valid 2024-05-27 23:31:44 +00:00
auparse meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
autodetect meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
avi gst-plugins-good: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
cutter cutter: add audio-level-meta 2024-02-08 13:52:40 +00:00
debugutils common: Stop using GQuark-based GstStructure field name API 2024-09-26 19:21:29 +03:00
deinterlace common: Use more efficient versions of GstCapsFeatures API where possible 2024-09-26 19:26:18 +03:00
dtmf rtpdtmfsrc: minor logging clean-up 2024-06-19 07:32:49 +00:00
effectv meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
equalizer meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
flv flvmux: Consider timestamps before segment start to map to segment start 2024-10-31 18:08:05 +00:00
flx meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
goom gst-plugins-good: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
goom2k1 meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
icydemux meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
id3demux meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
imagefreeze imagefreeze: Add support for JPEG / PNG 2024-10-18 06:53:04 +00:00
interleave gst-plugins-good: use g_sort_array() instead of deprecated g_qsort_with_data() 2024-09-02 22:31:34 +00:00
isomp4 qtdemux: fix parsing of matrix with 180 rotation 2024-10-14 16:54:38 +00:00
law meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
level level: fix old "message" property doc chunk 2024-05-23 21:36:37 +00:00
matroska matroskamux: Add support for latency timeouts in live pipelines 2024-10-01 13:20:18 +00:00
monoscope video: Don't overshoot QoS earliest time by a factor of 2 2024-09-13 19:52:52 +00:00
multifile common: Stop using GQuark-based GstStructure field name API 2024-09-26 19:21:29 +03:00
multipart meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
replaygain meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
rtp rtph264depay, rtph265depay: various parameter-set string handling fixes 2024-11-01 15:44:20 +00:00
rtpmanager rtpfunnel: Ensure segment events are forwarded after flushs 2024-11-05 14:31:03 +00:00
rtsp rtspsrc: client-managed MIKEY KeyMgmt 2024-10-24 12:43:11 +00:00
shapewipe video: Don't overshoot QoS earliest time by a factor of 2 2024-09-13 19:52:52 +00:00
smpte meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
spectrum meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
udp udpsrc: Disable allocated port reuse for unicast 2024-11-06 10:21:14 +00:00
videobox videocrop, videobox: Simplify navigation event handling and support touch events 2022-11-11 06:45:49 +00:00
videocrop videocrop, videobox: Simplify navigation event handling and support touch events 2022-11-11 06:45:49 +00:00
videofilter videoflip: fix concurrent access when modifying the tag list 2023-07-25 15:18:05 +02:00
videomixer video: Don't overshoot QoS earliest time by a factor of 2 2024-09-13 19:52:52 +00:00
wavenc gst-plugins-good: re-indent with GNU indent 2.2.12 2023-03-17 03:18:54 +00:00
wavparse wavparse: reset when receiving STREAM_START 2024-05-16 11:35:02 +00:00
xingmux xingmux: drop use of GSlice 2023-01-24 15:25:06 +00:00
y4m meson: Call pkgconfig.generate in the loop where we declare plugins dependencies 2022-09-01 21:17:35 +00:00
meson.build xingmux: move from gst-plugins-ugly to gst-plugins-good 2022-10-25 12:40:20 +00:00