diff options
author | Ermal <eri@pfsense.org> | 2010-04-29 16:12:08 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-04-29 16:12:08 +0000 |
commit | 95bd5c86c823fa2e04be537f176c2b780ab2864b (patch) | |
tree | 9355716d11c8aef647fc3f1da46d556df258ef35 | |
parent | ab3ebf88b2f48fc753dc72c8c085750732b2c8b2 (diff) | |
download | pfsense-95bd5c86c823fa2e04be537f176c2b780ab2864b.zip pfsense-95bd5c86c823fa2e04be537f176c2b780ab2864b.tar.gz |
Always generate macros so ruleset does not fail even when the gateway has no members.
-rw-r--r-- | etc/inc/filter.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 62982e5..51c88f9 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -545,10 +545,12 @@ function filter_generate_gateways() { foreach ($GatewaysList as $gwname => $gateway) { $int = $gateway['interface']; $gwip = $gateway['gateway']; + $route = ""; if (!is_ipaddr($gwip)) $gwip = get_interface_gateway($gateway['friendlyiface']); if (is_ipaddr($gwip) && !empty($int)) - $rules .= "{$gwname} = \" route-to ( {$int} {$gwip} ) \"\n"; + $route = "route-to ( {$int} {$gwip} )\n"; + $rules .= "{$gwname} = \" {$route} \"\n"; } } @@ -570,6 +572,7 @@ function filter_generate_gateways() { } else log_error("An error occurred while trying to find the interface got $gatewayip . The rule has not been added."); } + $route = ""; if ($foundlb > 0) { $route = " route-to { {$routeto} } "; if ($idx > 1) { @@ -577,8 +580,8 @@ function filter_generate_gateways() { if (isset($config['system']['lb_use_sticky'])) $route .= " sticky-address "; } - $rules .= "{$gateway} = \" {$route} \"\n"; } + $rules .= "{$gateway} = \" {$route} \"\n"; } } } |