mirror of
https://github.com/3proxy/3proxy.git
synced 2026-11-26 23:59:41 +08:00
Unify Linux namespace operations
This commit is contained in:
1 parent
f1b8d30799
commit
cc19bbff6d
10 files changed
+70
-109
No files matched your search
+1
-10
@@ -104,16 +104,7 @@ int udpbind(struct clientparam *param)
|
||||
SOCKET s;
|
||||
SASIZETYPE sasize;
|
||||
|
||||
#ifdef __linux__
|
||||
if (switch_ns(param->srv, param->srv->o_nsfd)) return 11;
|
||||
#endif
|
||||
s = param->srv->so._socket(param->sostate, SASOCK(¶m->sinsl), SOCK_DGRAM, IPPROTO_UDP);
|
||||
#ifdef __linux__
|
||||
if (switch_ns(param->srv, param->srv->i_nsfd)) {
|
||||
if (s != INVALID_SOCKET) param->srv->so._closesocket(param->sostate, s);
|
||||
return 11;
|
||||
}
|
||||
#endif
|
||||
s = nssocket(param->srv, ¶m->srv->so, param->sostate, NS_OUT, SASOCK(¶m->sinsl), SOCK_DGRAM, IPPROTO_UDP);
|
||||
if (s == INVALID_SOCKET) return 11;
|
||||
#ifdef _WIN32
|
||||
{ unsigned long ul = 1; ioctlsocket(s, FIONBIO, &ul); }
|
||||
|
||||
Reference in new issue
Block a user