mirror of https://github.com/F-Stack/f-stack.git
FreeBSD define IP_BINDANY in freebsd/netinet/in.h
Fstack should only support IP_BINDANY.
This commit is contained in:
parent
85d1417658
commit
37324d912f
|
@ -360,25 +360,28 @@ ngx_event_connect_set_transparent(ngx_peer_connection_t *pc, ngx_socket_t s)
|
||||||
|
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
|
|
||||||
#if defined(IP_TRANSPARENT)
|
#if defined(NGX_HAVE_FSTACK)
|
||||||
|
/****
|
||||||
if (setsockopt(s, IPPROTO_IP, IP_TRANSPARENT,
|
FreeBSD define IP_BINDANY in freebsd/netinet/in.h
|
||||||
(const void *) &value, sizeof(int)) == -1)
|
Fstack should only support IP_BINDANY.
|
||||||
|
****/
|
||||||
|
#define IP_BINDANY 24
|
||||||
|
if (setsockopt(s, IPPROTO_IP, IP_BINDANY,
|
||||||
|
(const void *) &value, sizeof(int)) == -1)
|
||||||
{
|
{
|
||||||
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
||||||
"setsockopt(IP_TRANSPARENT) failed");
|
"setsockopt(IP_BINDANY) failed");
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(IP_BINDANY)
|
#elif defined(IP_TRANSPARENT)
|
||||||
|
if (setsockopt(s, IPPROTO_IP, IP_TRANSPARENT,
|
||||||
if (setsockopt(s, IPPROTO_IP, IP_BINDANY,
|
(const void *) &value, sizeof(int)) == -1)
|
||||||
(const void *) &value, sizeof(int)) == -1)
|
{
|
||||||
{
|
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
||||||
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
|
"setsockopt(IP_TRANSPARENT) failed");
|
||||||
"setsockopt(IP_BINDANY) failed");
|
return NGX_ERROR;
|
||||||
return NGX_ERROR;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue