lib/upnp/Init: enable IPv6

This commit is contained in:
Max Kellermann 2018-01-31 18:15:46 +01:00
parent 3d5da1ac73
commit dead461542
2 changed files with 5 additions and 0 deletions

1
NEWS
View File

@ -3,6 +3,7 @@ ver 0.20.16 (not yet released)
- pulse: fix crash during auto-detection - pulse: fix crash during auto-detection
* database * database
- simple: fix search within mount points - simple: fix search within mount points
- upnp: enable IPv6
* fix crash in debug build on Haiku and other operating systems * fix crash in debug build on Haiku and other operating systems
ver 0.20.15 (2018/01/05) ver 0.20.15 (2018/01/05)

View File

@ -34,7 +34,11 @@ static unsigned upnp_ref;
static void static void
DoInit() DoInit()
{ {
#ifdef UPNP_ENABLE_IPV6
auto code = UpnpInit2(nullptr, 0);
#else
auto code = UpnpInit(nullptr, 0); auto code = UpnpInit(nullptr, 0);
#endif
if (code != UPNP_E_SUCCESS) if (code != UPNP_E_SUCCESS)
throw FormatRuntimeError("UpnpInit() failed: %s", throw FormatRuntimeError("UpnpInit() failed: %s",
UpnpGetErrorMessage(code)); UpnpGetErrorMessage(code));