mirror of
https://github.com/GOSTSec/gostcoin
synced 2025-03-13 05:41:11 +00:00
fixed windows build error
This commit is contained in:
parent
ebf102279f
commit
d08c15869a
@ -1868,15 +1868,15 @@ bool BindListenPort(const CService &addrBind, string& strError)
|
|||||||
// some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
|
// some systems don't have IPV6_V6ONLY but are always v6only; others do have the option
|
||||||
// and enable it by default or not. Try to enable it, if possible.
|
// and enable it by default or not. Try to enable it, if possible.
|
||||||
if (addrBind.IsIPv6()) {
|
if (addrBind.IsIPv6()) {
|
||||||
#ifdef IPV6_V6ONLY
|
|
||||||
setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int));
|
|
||||||
#endif
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */;
|
int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */;
|
||||||
int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */;
|
int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */;
|
||||||
// this call is allowed to fail
|
// this call is allowed to fail
|
||||||
setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int));
|
setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int));
|
||||||
|
#elif IPV6_V6ONLY
|
||||||
|
setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user