@@ -386,31 +386,22 @@ ngx_event_connect_set_transparent(ngx_peer_connection_t *pc, ngx_socket_t s)
386386
387387 case AF_INET :
388388
389- #if defined(NGX_HAVE_FSTACK )
390- /****
391- FreeBSD define IP_BINDANY in freebsd/netinet/in.h
392- Fstack should only support IP_BINDANY.
393- ****/
394- if (is_fstack_fd (s )){
395- optname = IP_BINDANY ;
396- } else {
397- optname = IP_TRANSPARENT ;
398- }
399-
400- if (setsockopt (s , IPPROTO_IP , optname ,
389+ #if defined(IP_TRANSPARENT )
390+ if (setsockopt (s , IPPROTO_IP , IP_TRANSPARENT ,
401391 (const void * ) & value , sizeof (int )) == -1 )
402392 {
403393 ngx_log_error (NGX_LOG_ALERT , pc -> log , ngx_socket_errno ,
404- "setsockopt(IP_BINDANY/ IP_TRANSPARENT) failed" );
394+ "setsockopt(IP_TRANSPARENT) failed" );
405395 return NGX_ERROR ;
406396 }
407397
408- #elif defined(IP_TRANSPARENT )
409- if (setsockopt (s , IPPROTO_IP , IP_TRANSPARENT ,
398+ #elif defined(IP_BINDANY )
399+
400+ if (setsockopt (s , IPPROTO_IP , IP_BINDANY ,
410401 (const void * ) & value , sizeof (int )) == -1 )
411402 {
412403 ngx_log_error (NGX_LOG_ALERT , pc -> log , ngx_socket_errno ,
413- "setsockopt(IP_TRANSPARENT ) failed" );
404+ "setsockopt(IP_BINDANY ) failed" );
414405 return NGX_ERROR ;
415406 }
416407
0 commit comments