diff options
author | Joe Orton <jorton@apache.org> | 2020-06-23 10:45:07 +0200 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2020-06-23 10:45:07 +0200 |
commit | 2f9cba2ad01a6dda48d19da475fea72ca3637104 (patch) | |
tree | 401e31110a3df9d3d23367f3f42f9d810b18d215 /server | |
parent | Add workaround for IPv6 configuration on non-x86 hosts which (diff) | |
download | apache2-2f9cba2ad01a6dda48d19da475fea72ca3637104.tar.xz apache2-2f9cba2ad01a6dda48d19da475fea72ca3637104.zip |
Add "v6only" Listen option to enable IPV6_V6ONLY in v4mapped builds
where it is otherwise always disabled.
* include/ap_listen.h: Define AP_LISTEN_V6ONLY.
* server/listen.c (make_sock): Set v6only_setting to 1 if
AP_LISTEN_V6ONLY flag is set for the listener.
(parse_listen_flags): Parse "v6only" flag.
PR: 54878
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879106 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/listen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/listen.c b/server/listen.c index 991a3f2c30..445d1202c9 100644 --- a/server/listen.c +++ b/server/listen.c @@ -78,7 +78,7 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server, int do_bind_ int one = 1; #if APR_HAVE_IPV6 #ifdef AP_ENABLE_V4_MAPPED - int v6only_setting = 0; + int v6only_setting = (server->flags & AP_LISTEN_V6ONLY) ? 1 : 0; #else int v6only_setting = 1; #endif @@ -1048,6 +1048,8 @@ static const char *parse_listen_flags(apr_pool_t *temp_pool, const char *arg, flags |= AP_LISTEN_FREEBIND; else if (ap_cstr_casecmp(token, "reuseport") == 0) flags |= AP_LISTEN_REUSEPORT; + else if (ap_cstr_casecmp(token, "v6only") == 0) + flags |= AP_LISTEN_V6ONLY; else return apr_psprintf(temp_pool, "Unknown Listen option '%s' in '%s'", token, arg); |