summaryrefslogtreecommitdiff
path: root/sql/sys_vars.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2017-08-22 21:08:38 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2017-08-22 21:08:38 +0200
commit58cd69fc808cade5ec3183a56b9d16957f0da02c (patch)
tree4ba0d41e6ad569efa3826162ac3505b103c90dc4 /sql/sys_vars.cc
parentd258a2bd1f8548bafc155d0ac1ed06c236d3fca2 (diff)
downloadmariadb-git-58cd69fc808cade5ec3183a56b9d16957f0da02c.tar.gz
MDEV-11159 Server proxy protocol support
accept proxy protocol header from client connections. The new server variable 'proxy_protocol_networks' contains list of networks from which proxy header is accepted.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 86a778388ac..6c60766edd2 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -4126,6 +4126,17 @@ static Sys_var_charptr Sys_license(
READ_ONLY GLOBAL_VAR(license), NO_CMD_LINE, IN_SYSTEM_CHARSET,
DEFAULT(STRINGIFY_ARG(LICENSE)));
+char *my_proxy_protocol_networks;
+static Sys_var_charptr Sys_proxy_protocol_networks(
+ "proxy_protocol_networks", "Enable proxy protocol for these source "
+ "networks. The syntax is a comma separated list of IPv4 and IPv6 "
+ "networks. If the network doesn't contain mask, it is considered to be "
+ "a single host. \"*\" represents all networks and must the only "
+ "directive on the line. String \"localhost\" represents non-TCP "
+ "local connections (Unix domain socket, Windows named pipe or shared memory).",
+ READ_ONLY GLOBAL_VAR(my_proxy_protocol_networks),
+ CMD_LINE(REQUIRED_ARG), IN_FS_CHARSET, DEFAULT(""));
+
static bool check_log_path(sys_var *self, THD *thd, set_var *var)
{
if (!var->value)