From f4d8f173000060e2966db3b583bd30392a16a9a0 Mon Sep 17 00:00:00 2001 From: JianJianChen Date: Mon, 9 Sep 2019 13:33:26 +0800 Subject: [PATCH] fix a bug, [alert] 10485#0: *3 sendmsg() failed (92: Protocol not available) while proxying and sending to client, udp client --- app/nginx-1.16.0/src/os/unix/ngx_udp_sendmsg_chain.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/nginx-1.16.0/src/os/unix/ngx_udp_sendmsg_chain.c b/app/nginx-1.16.0/src/os/unix/ngx_udp_sendmsg_chain.c index b6d269985..d164275c9 100644 --- a/app/nginx-1.16.0/src/os/unix/ngx_udp_sendmsg_chain.c +++ b/app/nginx-1.16.0/src/os/unix/ngx_udp_sendmsg_chain.c @@ -207,11 +207,11 @@ ngx_sendmsg(ngx_connection_t *c, ngx_iovec_t *vec) #if (NGX_HAVE_IP_SENDSRCADDR) u_char msg_control[CMSG_SPACE(sizeof(struct in_addr))]; -#elif (NGX_HAVE_IP_PKTINFO) +#elif (NGX_HAVE_IP_PKTINFO) && (!NGX_HAVE_FSTACK) u_char msg_control[CMSG_SPACE(sizeof(struct in_pktinfo))]; #endif -#if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO) +#if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO && !NGX_HAVE_FSTACK) u_char msg_control6[CMSG_SPACE(sizeof(struct in6_pktinfo))]; #endif @@ -252,7 +252,7 @@ ngx_sendmsg(ngx_connection_t *c, ngx_iovec_t *vec) *addr = sin->sin_addr; } -#elif (NGX_HAVE_IP_PKTINFO) +#elif (NGX_HAVE_IP_PKTINFO) && (!NGX_HAVE_FSTACK) if (c->local_sockaddr->sa_family == AF_INET) { struct cmsghdr *cmsg; @@ -276,7 +276,7 @@ ngx_sendmsg(ngx_connection_t *c, ngx_iovec_t *vec) #endif -#if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO) +#if (NGX_HAVE_INET6 && NGX_HAVE_IPV6_RECVPKTINFO && !NGX_HAVE_FSTACK) if (c->local_sockaddr->sa_family == AF_INET6) { struct cmsghdr *cmsg;