mirror of
https://github.com/status-im/miniupnp.git
synced 2025-02-18 17:06:51 +00:00
miniupnpc.c: use unsigned long for IP_MULTICAST_TTL with win32
fixes 1da63faa4fff5cb30e5d4b848ceef80a292382b9 for win32
This commit is contained in:
parent
739e0b914a
commit
aba8c3f3d7
@ -381,6 +381,7 @@ upnpDiscoverDevices(const char * const deviceTypes[],
|
|||||||
#endif
|
#endif
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
MIB_IPFORWARDROW ip_forward;
|
MIB_IPFORWARDROW ip_forward;
|
||||||
|
unsigned long _ttl = (unsigned long)ttl;
|
||||||
#endif
|
#endif
|
||||||
int linklocal = 1;
|
int linklocal = 1;
|
||||||
|
|
||||||
@ -528,7 +529,11 @@ upnpDiscoverDevices(const char * const deviceTypes[],
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_TTL, &_ttl, sizeof(_ttl)) < 0)
|
||||||
|
#else /* _WIN32 */
|
||||||
if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0)
|
if(setsockopt(sudp, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) < 0)
|
||||||
|
#endif /* _WIN32 */
|
||||||
{
|
{
|
||||||
/* not a fatal error */
|
/* not a fatal error */
|
||||||
PRINT_SOCKET_ERROR("setsockopt(IP_MULTICAST_TTL,...)");
|
PRINT_SOCKET_ERROR("setsockopt(IP_MULTICAST_TTL,...)");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user