diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c index cb12c59..7f68fc5 100644 --- a/miniupnpc/minissdpc.c +++ b/miniupnpc/minissdpc.c @@ -570,12 +570,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[], * in order to give this ip to setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_IF) */ if(!ipv6) { DWORD ifbestidx; - SOCKADDR_IN destAddr; - memset(&destAddr, 0, sizeof(destAddr)); - destAddr.sin_family = AF_INET; - destAddr.sin_addr.s_addr = inet_addr("223.255.255.255"); - destAddr.sin_port = 0; - if (GetBestInterfaceEx((struct sockaddr *)&destAddr, &ifbestidx) == NO_ERROR) { + if (GetBestInterface(inet_addr("223.255.255.255"), &ifbestidx) == NO_ERROR) { DWORD dwRetVal = NO_ERROR; PIP_ADAPTER_ADDRESSES pAddresses = NULL; ULONG outBufLen = 15360;