upnp: exclusively use `UnpnInit2`
- Apr 10, 2022
-
-
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 -
Use specialized libupnp defines instead of a boolean since `GetIpv4ForMulticast` was dropped before.
7628be6b -
Support for older versions was dropped by the previous commits.
6eed7670 -
`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 -
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 -
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
-