mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 03:35:38 +03:00
42 lines
1.2 KiB
Diff
42 lines
1.2 KiB
Diff
--- nginx-1.11.3/src/http/ngx_http_core_module.c
|
|
+++ nginx-1.11.3/src/http/ngx_http_core_module.c.new
|
|
@@ -2948,7 +2948,11 @@
|
|
ngx_uint_t i;
|
|
ngx_conf_t pcf;
|
|
ngx_http_module_t *module;
|
|
+#if (NGX_HAVE_INET6)
|
|
+ struct sockaddr_in6 *sin6;
|
|
+#else
|
|
struct sockaddr_in *sin;
|
|
+#endif
|
|
ngx_http_conf_ctx_t *ctx, *http_ctx;
|
|
ngx_http_listen_opt_t lsopt;
|
|
ngx_http_core_srv_conf_t *cscf, **cscfp;
|
|
@@ -3032,6 +3036,19 @@
|
|
if (rv == NGX_CONF_OK && !cscf->listen) {
|
|
ngx_memzero(&lsopt, sizeof(ngx_http_listen_opt_t));
|
|
|
|
+#if (NGX_HAVE_INET6)
|
|
+ sin6 = &lsopt.sockaddr.sockaddr_in6;
|
|
+
|
|
+ sin6->sin6_family = AF_INET6;
|
|
+#if (NGX_WIN32)
|
|
+ sin6->sin6_port = htons(80);
|
|
+#else
|
|
+ sin6->sin6_port = htons((getuid() == 0) ? 80 : 8000);
|
|
+#endif
|
|
+ sin6->sin6_addr = in6addr_any;
|
|
+
|
|
+ lsopt.socklen = sizeof(struct sockaddr_in6);
|
|
+#else
|
|
sin = &lsopt.sockaddr.sockaddr_in;
|
|
|
|
sin->sin_family = AF_INET;
|
|
@@ -3043,6 +3060,7 @@
|
|
sin->sin_addr.s_addr = INADDR_ANY;
|
|
|
|
lsopt.socklen = sizeof(struct sockaddr_in);
|
|
+#endif
|
|
|
|
lsopt.backlog = NGX_LISTEN_BACKLOG;
|
|
lsopt.rcvbuf = -1;
|