From 2fcd42a78c7f6fb9944a832eac820e7cf08c0226 Mon Sep 17 00:00:00 2001 From: PiBa-NL Date: Sat, 22 Jun 2013 00:26:17 +0200 Subject: haproxy-devel, 'transparent proxy' bugfix, proper interfaces initialized for ipfw --- config/haproxy-devel/haproxy.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/haproxy-devel/haproxy.inc b/config/haproxy-devel/haproxy.inc index b5ca35cd..3afefb49 100644 --- a/config/haproxy-devel/haproxy.inc +++ b/config/haproxy-devel/haproxy.inc @@ -887,6 +887,7 @@ function load_ipfw_rules() { haproxy_load_modules(); + $transparent_interfaces = array(); $transparent_backends = array(); foreach ($a_backends as $backend) { if ($backend["transparent_clientip"] != 'yes') @@ -904,14 +905,19 @@ function load_ipfw_rules() { $item = array(); $item['address'] = $be['address']; $item['port'] = $be['port']; - $item['interface'] = $real_if;//"em0"; + $item['interface'] = $real_if; $transparent_backends[] = $item; + $transparent_interfaces[$real_if] = 1; } } } } mwexec("/usr/local/sbin/ipfw_context -a $ipfw_zone_haproxy", true); - mwexec("/usr/local/sbin/ipfw_context -a $ipfw_zone_haproxy -n em0", true); + + foreach($transparent_interfaces as $transparent_if => $value) { + mwexec("/usr/local/sbin/ipfw_context -a $ipfw_zone_haproxy -n $transparent_if", true); + } + $rulenum = 64000; // why that high? captiveportal.inc also does it... $rules = "flush\n"; foreach($transparent_backends as $transparent_be) { -- cgit v1.2.3