diff --git a/modules/services_discovery/upnp-wrapper.cpp b/modules/services_discovery/upnp-wrapper.cpp
index ab9da08385906c08a3b06f0514261f12a2709a13..01c0dcb6e02d8dfb93768c961dbecb14bbe3e2a1 100644
--- a/modules/services_discovery/upnp-wrapper.cpp
+++ b/modules/services_discovery/upnp-wrapper.cpp
@@ -57,20 +57,17 @@ UpnpInstanceWrapper *UpnpInstanceWrapper::get(vlc_object_t *p_obj)
             return NULL;
         }
 
-        /* libupnp 1.8 deprecate `UpnpInit` and introduce `UpnpInit2` as a replacement. */
-    #if UPNP_VERSION >= 10800
-        char* psz_miface = var_InheritString( p_obj, "miface" );
-        if (psz_miface == NULL)
-            psz_miface = getPreferedAdapter();
-        msg_Info( p_obj, "Initializing libupnp on '%s' interface", psz_miface ? psz_miface : "default" );
-        int i_res = UpnpInit2( psz_miface, 0 );
-        free( psz_miface );
-    #else
-        /* If UpnpInit2 isn't available, initialize on first IPv4-capable interface */
-        char *psz_hostip = getIpv4ForMulticast();
-        int i_res = UpnpInit( psz_hostip, 0 );
-        free(psz_hostip);
-    #endif /* UPNP_VERSION >= 10800 */
+        char *net_iface = var_InheritString( p_obj, "miface" );
+        if ( net_iface == NULL )
+        {
+            // No forced multicast network interface, select one by default.
+            net_iface = getPreferedAdapter();
+        }
+        msg_Info( p_obj, "Initializing libupnp on '%s' interface",
+                  net_iface ? net_iface : "default" );
+        int i_res = UpnpInit2( net_iface, 0 );
+        free( net_iface );
+
         if( i_res != UPNP_E_SUCCESS )
         {
             msg_Err( p_obj, "Initialization failed: %s", UpnpGetErrorMessage( i_res ) );
diff --git a/modules/services_discovery/upnp-wrapper.hpp b/modules/services_discovery/upnp-wrapper.hpp
index b999078297c829c7c46d781681a9e12951a10f18..96b448a867224d7477714a37cfc97e12459ee8b4 100644
--- a/modules/services_discovery/upnp-wrapper.hpp
+++ b/modules/services_discovery/upnp-wrapper.hpp
@@ -236,93 +236,6 @@ inline char* getPreferedAdapter()
     free(addresses);
     return NULL;
 }
-
-inline char *getIpv4ForMulticast()
-{
-    IP_ADAPTER_UNICAST_ADDRESS *p_best_ip = NULL;
-    wchar_t psz_uri[32];
-    DWORD strSize;
-    IP_ADAPTER_ADDRESSES *p_adapter, *addresses;
-
-    addresses = ListAdapters();
-    if (addresses == NULL)
-        return NULL;
-
-    /* find one with multicast capabilities */
-    p_adapter = addresses;
-    while (p_adapter != NULL)
-    {
-        if (isAdapterSuitable( p_adapter, false ))
-        {
-            /* make sure it supports 239.255.255.250 */
-            IP_ADAPTER_MULTICAST_ADDRESS *p_multicast = getMulticastAddress( p_adapter );
-            if (p_multicast != NULL)
-            {
-                /* get an IPv4 address */
-                IP_ADAPTER_UNICAST_ADDRESS *p_unicast = p_adapter->FirstUnicastAddress;
-                while (p_unicast != NULL)
-                {
-                    strSize = sizeof( psz_uri ) / sizeof( wchar_t );
-                    if( WSAAddressToString( p_unicast->Address.lpSockaddr,
-                                            p_unicast->Address.iSockaddrLength,
-                                            NULL, psz_uri, &strSize ) == 0 )
-                    {
-                        if ( p_best_ip == NULL ||
-                             p_best_ip->ValidLifetime > p_unicast->ValidLifetime )
-                        {
-                            p_best_ip = p_unicast;
-                        }
-                    }
-                    p_unicast = p_unicast->Next;
-                }
-            }
-        }
-        p_adapter = p_adapter->Next;
-    }
-
-    if ( p_best_ip != NULL )
-        goto done;
-
-    /* find any with IPv4 */
-    p_adapter = addresses;
-    while (p_adapter != NULL)
-    {
-        if (isAdapterSuitable(p_adapter, false))
-        {
-            /* get an IPv4 address */
-            IP_ADAPTER_UNICAST_ADDRESS *p_unicast = p_adapter->FirstUnicastAddress;
-            while (p_unicast != NULL)
-            {
-                strSize = sizeof( psz_uri ) / sizeof( wchar_t );
-                if( WSAAddressToString( p_unicast->Address.lpSockaddr,
-                                        p_unicast->Address.iSockaddrLength,
-                                        NULL, psz_uri, &strSize ) == 0 )
-                {
-                    if ( p_best_ip == NULL ||
-                         p_best_ip->ValidLifetime > p_unicast->ValidLifetime )
-                    {
-                        p_best_ip = p_unicast;
-                    }
-                }
-                p_unicast = p_unicast->Next;
-            }
-        }
-        p_adapter = p_adapter->Next;
-    }
-
-done:
-    if (p_best_ip != NULL)
-    {
-        strSize = sizeof( psz_uri ) / sizeof( wchar_t );
-        WSAAddressToString( p_best_ip->Address.lpSockaddr,
-                            p_best_ip->Address.iSockaddrLength,
-                            NULL, psz_uri, &strSize );
-        free(addresses);
-        return FromWide( psz_uri );
-    }
-    free(addresses);
-    return NULL;
-}
 #else /* _WIN32 */
 
 #ifdef __APPLE__
@@ -400,59 +313,6 @@ inline char *getPreferedAdapter()
 
 #endif
 
-#ifdef __APPLE__
-
-inline bool necessaryFlagsSetOnInterface(struct ifaddrs *anInterface)
-{
-    unsigned int flags = anInterface->ifa_flags;
-    if( (flags & IFF_UP) && (flags & IFF_RUNNING) && !(flags & IFF_LOOPBACK) && !(flags & IFF_POINTOPOINT) ) {
-        return true;
-    }
-    return false;
-}
-
-static char *getIpv4ForMulticast()
-{
-    struct ifaddrs *listOfInterfaces;
-    struct ifaddrs *anInterface;
-    int ret = getifaddrs(&listOfInterfaces);
-    char *bestIP = NULL;
-
-    if (ret != 0) {
-        return NULL;
-    }
-
-    anInterface = listOfInterfaces;
-    while (anInterface != NULL) {
-        if (anInterface->ifa_addr->sa_family == AF_INET) {
-            bool ret = necessaryFlagsSetOnInterface(anInterface);
-            if (ret) {
-                /* ignore sockets connecting to the touchbar on MacBooks */
-                if (strncmp(anInterface->ifa_name, "bridge", 6) != 0) {
-                    if (bestIP) {
-                        FREENULL(bestIP);
-                    }
-                    bestIP = strdup(inet_ntoa(((struct sockaddr_in *)anInterface->ifa_addr)->sin_addr));
-                }
-            }
-        }
-
-        anInterface = anInterface->ifa_next;
-    }
-    freeifaddrs(listOfInterfaces);
-
-    return bestIP;
-}
-
-#else
-
-static char *getIpv4ForMulticast()
-{
-    return NULL;
-}
-
-#endif
-
 #endif /* _WIN32 */
 
 #endif