Skip to content
Snippets Groups Projects

upnp: exclusively use `UnpnInit2`

Merged Alaric Senat requested to merge asenat/vlc:drop-upnp-init into master
  1. Apr 10, 2022
    • Alaric Senat's avatar
      upnp: win32: accept net-intf that support both IPv4/6 · b9daafa9
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Previously when libupnp was built with IPv6 enabled only the adapters
      supporting IPv6 were accepted. libupnp does support IPv4 even when built
      with IPv6, this commit accept both kinds of adapters instead of
      excluding the ones that does not support IPv6 at all.
      b9daafa9
    • Alaric Senat's avatar
      upnp: win32: simplify IPv6 handling · 7628be6b
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Use specialized libupnp defines instead of a boolean since
      `GetIpv4ForMulticast` was dropped before.
      7628be6b
    • Alaric Senat's avatar
      upnp: removes code depending on libupnp < 1.8.3 · 6eed7670
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Support for older versions was dropped by the previous commits.
      6eed7670
    • Alaric Senat's avatar
      upnp: exclusively use `UpnpInit2` · 8e05bad0
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      `UpnpInit` is deprecated and unmaintained since 1.6. It is known to be
      vulnerable (CVE-2020-12695). Dropping its support simplifies a lot the
      network code as solely a net interface name is required by `UpnpInit2`
      now.
      8e05bad0
    • Alaric Senat's avatar
      upnp: change required version to 1.8.3 · 9fd11b9c
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      This version gives access to `UpnpInit2` for both IPv6 and IPv4.
      `UpnpInit` is deprecated since 1.6 and less safe than `UpnpInit2`.
      
      Libupnp 1.8.3 has been out since 2017 and has been widely adopted in
      most linux distributions now (available on debian since version 10).
      Dropping support for lower versions will allow us to completely remove
      `UpnpInit` from the codebase and simplify a lot the netintf selection
      code.
      9fd11b9c
    • Alaric Senat's avatar
      sout: dlna: simplify `GetServerIPAddress` · e3d29038
      Alaric Senat authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Prefer using the UPNP API calls to get the selected interface's IP
      address.  The code removed is unnecessarily complex as the correct IP
      address should already be available and exposed by libupnp.
      
      Also avoids an unhandled `strdup(nullptr)` in case of error.
      e3d29038
Loading