mirror of https://github.com/F-Stack/f-stack.git
IPv6: Nginx supportted ipv6, but not incloud bind to host.
This commit is contained in:
parent
35fdfcdb22
commit
e064dbd16a
|
@ -219,7 +219,7 @@ fstack_territory(int domain, int type, int protocol)
|
|||
type &= ~SOCK_NONBLOCK;
|
||||
type &= ~SOCK_FSTACK;
|
||||
|
||||
if ((AF_INET != domain) || (SOCK_STREAM != type && SOCK_DGRAM != type)) {
|
||||
if ((AF_INET != domain && AF_INET6 != domain) || (SOCK_STREAM != type && SOCK_DGRAM != type)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -231,14 +231,20 @@ socket(int domain, int type, int protocol)
|
|||
{
|
||||
int sock;
|
||||
if (unlikely(inited == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
if (unlikely(fstack_territory(domain, type, protocol) == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
if (unlikely((type & SOCK_FSTACK) == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
|
|
|
@ -219,7 +219,7 @@ fstack_territory(int domain, int type, int protocol)
|
|||
type &= ~SOCK_NONBLOCK;
|
||||
type &= ~SOCK_FSTACK;
|
||||
|
||||
if ((AF_INET != domain) || (SOCK_STREAM != type && SOCK_DGRAM != type)) {
|
||||
if ((AF_INET != domain && AF_INET6 != domain) || (SOCK_STREAM != type && SOCK_DGRAM != type)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -231,14 +231,20 @@ socket(int domain, int type, int protocol)
|
|||
{
|
||||
int sock;
|
||||
if (unlikely(inited == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
if (unlikely(fstack_territory(domain, type, protocol) == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
if (unlikely((type & SOCK_FSTACK) == 0)) {
|
||||
if (AF_INET6 == domain)
|
||||
domain = AF_INET6_LINUX;
|
||||
return SYSCALL(socket)(domain, type, protocol);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue