Resolves: #1949606 - RFE: httpd, add IP_FREEBIND support for Listen
This commit is contained in:
parent
eec74b76f8
commit
16516bd59b
124
httpd-2.4.46-freebind.patch
Normal file
124
httpd-2.4.46-freebind.patch
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
diff --git a/docs/manual/mod/mpm_common.html.en b/docs/manual/mod/mpm_common.html.en
|
||||||
|
index e7af21d..01d54b7 100644
|
||||||
|
--- a/docs/manual/mod/mpm_common.html.en
|
||||||
|
+++ b/docs/manual/mod/mpm_common.html.en
|
||||||
|
@@ -42,6 +42,7 @@ more than one multi-processing module (MPM)</td></tr>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#enableexceptionhook">EnableExceptionHook</a></li>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#gracefulshutdowntimeout">GracefulShutdownTimeout</a></li>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#listen">Listen</a></li>
|
||||||
|
+<li><img alt="" src="../images/down.gif" /> <a href="#listenfree">ListenFree</a></li>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#listenbacklog">ListenBackLog</a></li>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#listencoresbucketsratio">ListenCoresBucketsRatio</a></li>
|
||||||
|
<li><img alt="" src="../images/down.gif" /> <a href="#maxconnectionsperchild">MaxConnectionsPerChild</a></li>
|
||||||
|
@@ -244,6 +245,31 @@ discussion of the <code>Address already in use</code> error message,
|
||||||
|
including other causes.</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
+
|
||||||
|
+<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
|
||||||
|
+<div class="directive-section"><h2><a name="ListenFree" id="ListenFree">ListenFree</a> <a name="listenfree" id="listenfree">Directive</a></h2>
|
||||||
|
+<table class="directive">
|
||||||
|
+<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>IP addresses and ports that the server
|
||||||
|
+listens to. Doesn't require IP address to be up</td></tr>
|
||||||
|
+<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ListenFree [<var>IP-address</var>:]<var>portnumber</var> [<var>protocol</var>]</code></td></tr>
|
||||||
|
+<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
|
||||||
|
+<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>MPM</td></tr>
|
||||||
|
+<tr><th><a href="directive-dict.html#Module">Module:</a></th><td><code class="module"><a href="../mod/event.html">event</a></code>, <code class="module"><a href="../mod/worker.html">worker</a></code>, <code class="module"><a href="../mod/prefork.html">prefork</a></code>, <code class="module"><a href="../mod/mpm_winnt.html">mpm_winnt</a></code>, <code class="module"><a href="../mod/mpm_netware.html">mpm_netware</a></code>, <code class="module"><a href="../mod/mpmt_os2.html">mpmt_os2</a></code></td></tr>
|
||||||
|
+<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>This directive is currently available only in Red Hat Enterprise Linux</td></tr>
|
||||||
|
+</table>
|
||||||
|
+ <p>The <code class="directive">ListenFree</code> directive is
|
||||||
|
+ identical to the <code class="directive">Listen</code> directive.
|
||||||
|
+ The only difference is in the usage of the IP_FREEBIND socket
|
||||||
|
+ option, which is enabled by default with <code class="directive">ListenFree</code>.
|
||||||
|
+ If IP_FREEBIND is enabled, it allows httpd to bind to an IP
|
||||||
|
+ address that is nonlocal or does not (yet) exist. This allows httpd to
|
||||||
|
+ listen on a socket without requiring the underlying network interface
|
||||||
|
+ or the specified dynamic IP address to be up at the time when httpd
|
||||||
|
+ is trying to bind to it.
|
||||||
|
+ </p>
|
||||||
|
+</div>
|
||||||
|
+
|
||||||
|
+
|
||||||
|
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
|
||||||
|
<div class="directive-section"><h2><a name="ListenBackLog" id="ListenBackLog">ListenBackLog</a> <a name="listenbacklog" id="listenbacklog">Directive</a></h2>
|
||||||
|
<table class="directive">
|
||||||
|
diff --git a/include/ap_listen.h b/include/ap_listen.h
|
||||||
|
index 58c2574..1a53292 100644
|
||||||
|
--- a/include/ap_listen.h
|
||||||
|
+++ b/include/ap_listen.h
|
||||||
|
@@ -137,6 +137,9 @@ AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd, void *dummy
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_listencbratio(cmd_parms *cmd, void *dummy, const char *arg);
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
|
||||||
|
int argc, char *const argv[]);
|
||||||
|
+AP_DECLARE_NONSTD(const char *) ap_set_freelistener(cmd_parms *cmd, void *dummy,
|
||||||
|
+ int argc, char *const argv[]);
|
||||||
|
+
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_send_buffer_size(cmd_parms *cmd, void *dummy,
|
||||||
|
const char *arg);
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_receive_buffer_size(cmd_parms *cmd,
|
||||||
|
@@ -150,6 +153,8 @@ AP_INIT_TAKE1("ListenCoresBucketsRatio", ap_set_listencbratio, NULL, RSRC_CONF,
|
||||||
|
"Ratio between the number of CPU cores (online) and the number of listeners buckets"), \
|
||||||
|
AP_INIT_TAKE_ARGV("Listen", ap_set_listener, NULL, RSRC_CONF, \
|
||||||
|
"A port number or a numeric IP address and a port number, and an optional protocol"), \
|
||||||
|
+AP_INIT_TAKE_ARGV("ListenFree", ap_set_freelistener, NULL, RSRC_CONF, \
|
||||||
|
+ "A port number or a numeric IP address and a port number, and an optional protocol"), \
|
||||||
|
AP_INIT_TAKE1("SendBufferSize", ap_set_send_buffer_size, NULL, RSRC_CONF, \
|
||||||
|
"Send buffer size in bytes"), \
|
||||||
|
AP_INIT_TAKE1("ReceiveBufferSize", ap_set_receive_buffer_size, NULL, \
|
||||||
|
diff --git a/server/listen.c b/server/listen.c
|
||||||
|
index e2e028a..6ef664b 100644
|
||||||
|
--- a/server/listen.c
|
||||||
|
+++ b/server/listen.c
|
||||||
|
@@ -63,6 +63,7 @@ static int ap_listenbacklog;
|
||||||
|
static int ap_listencbratio;
|
||||||
|
static int send_buffer_size;
|
||||||
|
static int receive_buffer_size;
|
||||||
|
+static int ap_listenfreebind;
|
||||||
|
#ifdef HAVE_SYSTEMD
|
||||||
|
static int use_systemd = -1;
|
||||||
|
#endif
|
||||||
|
@@ -162,6 +163,21 @@ static apr_status_t make_sock(apr_pool_t *p, ap_listen_rec *server, int do_bind_
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+
|
||||||
|
+#if defined(APR_SO_FREEBIND)
|
||||||
|
+ if (ap_listenfreebind) {
|
||||||
|
+ if (apr_socket_opt_set(s, APR_SO_FREEBIND, one) < 0) {
|
||||||
|
+ stat = apr_get_netos_error();
|
||||||
|
+ ap_log_perror(APLOG_MARK, APLOG_CRIT, stat, p, APLOGNO(02182)
|
||||||
|
+ "make_sock: apr_socket_opt_set: "
|
||||||
|
+ "error setting APR_SO_FREEBIND");
|
||||||
|
+ apr_socket_close(s);
|
||||||
|
+ return stat;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+
|
||||||
|
if (do_bind_listen) {
|
||||||
|
#if APR_HAVE_IPV6
|
||||||
|
if (server->bind_addr->family == APR_INET6) {
|
||||||
|
@@ -956,6 +972,7 @@ AP_DECLARE(void) ap_listen_pre_config(void)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
|
||||||
|
int argc, char *const argv[])
|
||||||
|
{
|
||||||
|
@@ -1016,6 +1033,14 @@ AP_DECLARE_NONSTD(const char *) ap_set_listener(cmd_parms *cmd, void *dummy,
|
||||||
|
return alloc_listener(cmd->server->process, host, port, proto, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
+AP_DECLARE_NONSTD(const char *) ap_set_freelistener(cmd_parms *cmd, void *dummy,
|
||||||
|
+ int argc,
|
||||||
|
+ char *const argv[])
|
||||||
|
+{
|
||||||
|
+ ap_listenfreebind = 1;
|
||||||
|
+ return ap_set_listener(cmd, dummy, argc, argv);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
AP_DECLARE_NONSTD(const char *) ap_set_listenbacklog(cmd_parms *cmd,
|
||||||
|
void *dummy,
|
||||||
|
const char *arg)
|
@ -13,7 +13,7 @@
|
|||||||
Summary: Apache HTTP Server
|
Summary: Apache HTTP Server
|
||||||
Name: httpd
|
Name: httpd
|
||||||
Version: 2.4.46
|
Version: 2.4.46
|
||||||
Release: 14%{?dist}
|
Release: 15%{?dist}
|
||||||
URL: https://httpd.apache.org/
|
URL: https://httpd.apache.org/
|
||||||
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
|
Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
|
||||||
Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
|
Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc
|
||||||
@ -89,6 +89,9 @@ Patch45: httpd-2.4.43-logjournal.patch
|
|||||||
Patch46: httpd-2.4.46-proxy-ws-idle-timeout.patch
|
Patch46: httpd-2.4.46-proxy-ws-idle-timeout.patch
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1949969
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1949969
|
||||||
Patch47: httpd-2.4.43-pr37355.patch
|
Patch47: httpd-2.4.43-pr37355.patch
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1949606
|
||||||
|
Patch48: httpd-2.4.46-freebind.patch
|
||||||
|
|
||||||
|
|
||||||
# Bug fixes
|
# Bug fixes
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1397243
|
||||||
@ -244,6 +247,7 @@ written in the Lua programming language.
|
|||||||
%patch45 -p1 -b .logjournal
|
%patch45 -p1 -b .logjournal
|
||||||
%patch46 -p1 -b .proxy-ws-idle-timeout
|
%patch46 -p1 -b .proxy-ws-idle-timeout
|
||||||
%patch47 -p1 -b .pr37355
|
%patch47 -p1 -b .pr37355
|
||||||
|
%patch48 -p1 -b .freebind
|
||||||
|
|
||||||
%patch60 -p1 -b .enable-sslv3
|
%patch60 -p1 -b .enable-sslv3
|
||||||
%patch62 -p1 -b .r1870095
|
%patch62 -p1 -b .r1870095
|
||||||
@ -789,6 +793,9 @@ exit $rv
|
|||||||
%{_rpmconfigdir}/macros.d/macros.httpd
|
%{_rpmconfigdir}/macros.d/macros.httpd
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed May 26 2021 Luboš Uhliarik <luhliari@redhat.com> - 2.4.46-15
|
||||||
|
- Resolves: #1949606 - RFE: httpd, add IP_FREEBIND support for Listen
|
||||||
|
|
||||||
* Wed May 19 2021 Lubos Uhliarik <luhliari@redhat.com> - 2.4.46-14
|
* Wed May 19 2021 Lubos Uhliarik <luhliari@redhat.com> - 2.4.46-14
|
||||||
- Resolves: #1949969 - httpd : mod_proxy should allow to specify
|
- Resolves: #1949969 - httpd : mod_proxy should allow to specify
|
||||||
Proxy-Authorization in ProxyRemote directive
|
Proxy-Authorization in ProxyRemote directive
|
||||||
|
Loading…
Reference in New Issue
Block a user