aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/haproxy.inc
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-03 12:59:30 -0800
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-12-03 12:59:30 -0800
commit7a1c41798ccc8bd5ae8c8b6b6989318590ba04d3 (patch)
tree3244f7e2f9ffb491c24fb3c42452c87d7a3269c6 /config/haproxy-devel/haproxy.inc
parentc78e013f003042cfe878babddeb20925a7402450 (diff)
parent6dd91cb086f926c9ddea2a188141bbbd7f071bed (diff)
downloadpfsense-packages-7a1c41798ccc8bd5ae8c8b6b6989318590ba04d3.tar.gz
pfsense-packages-7a1c41798ccc8bd5ae8c8b6b6989318590ba04d3.tar.bz2
pfsense-packages-7a1c41798ccc8bd5ae8c8b6b6989318590ba04d3.zip
Merge pull request #557 from PiBa-NL/haproxy_spellcheck
haproxy-devel, -made more consistent use of frontend/backend text
Diffstat (limited to 'config/haproxy-devel/haproxy.inc')
-rw-r--r--config/haproxy-devel/haproxy.inc25
1 files changed, 24 insertions, 1 deletions
diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc
index 4da961de..f768ef01 100644
--- a/config/haproxy-devel/haproxy.inc
+++ b/config/haproxy-devel/haproxy.inc
@@ -281,6 +281,18 @@ EOD;
$bind['httpclose'] = "httpclose";
$writeconfigupdate = true;
}
+ if (!$bind['extaddr']){
+ $bind['extaddr'] = "wan_ipv4";
+ $writeconfigupdate = true;
+ }
+ if ($bind['extaddr'] == "localhost"){
+ $bind['extaddr'] = "localhost_ipv4";
+ $writeconfigupdate = true;
+ }
+ if ($bind['extaddr'] == "any"){
+ $bind['extaddr'] = "any_ipv4";
+ $writeconfigupdate = true;
+ }
}
}
if ($writeconfigupdate)
@@ -721,7 +733,7 @@ function haproxy_writeconf($configfile) {
fwrite ($fd, "\ttimeout client\t\t" . $bind['client_timeout'] . "\n");
- // Combine the rest of the listener configs
+ // Combine the rest of the frontend configs
$default_backend = "";
$i = 0;
foreach ($bind['config'] as $bconfig) {
@@ -1124,6 +1136,17 @@ function get_frontend_acls($frontend) {
return $result;
}
+function get_backend($name) {
+ global $config;
+ $a_backend = &$config['installedpackages']['haproxy']['ha_pools']['item'];
+ foreach($a_backend as $key => $backend)
+ {
+ if ($backend['name'] == $name)
+ return $backend;
+ }
+ return null;
+}
+
function haproxy_escapestring($configurationsting) {
$result = str_replace('\\', '\\\\', $configurationsting);
$result = str_replace(' ', '\\ ', $result);