GNOME Bugzilla – Bug 795268
udpsrc listens on Legacy IP only
Last modified: 2018-11-03 15:29:03 UTC
Using 'udpsrc port=7200' in my pipeline only listens on the Legacy IP address 0.0.0.0 by default, instead of [::].
That's because 0.0.0.0 is the default setting of the corresponding property on udpsrc. Switching it to anything else now would likely break existing applications that assume 0.0.0.0 is the default and that send data to 0.0.0.0 instead of [::]
In most cases IPV6_V6ONLY isn't set, so listening on [::] would also accept Legacy IP connections too. The conventional trick is to bind to [::] first, then also attempt to bind to 0.0.0.0. If the latter fails, the former is accepting Legacy IP. There should be no need for compatibility concerns.
While this works on Linux at least, if I remember this behaves different on Windows and also BSDs.
Right. Windows and BSDs (and Linux with IPV6_V6ONLY) are why you listen on *both* [::] and 0.0.0.0 at the same time. Sometime the latter bind will fail because the first has covered it. Other times, you end up with both. And it works everywhere.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/464.