diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2008-12-04 17:44:08 +0000 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2008-12-04 17:44:08 +0000 |
commit | 31597ebf2ca42c26f6f3e8521da5695012284997 (patch) | |
tree | 3fd9c23622cec4a78f146b12b3b6212b70ade257 /etc/inc | |
parent | 96bcab8b3b24f339a9eb4919d9cf4d9f92672b8e (diff) | |
download | pfsense-31597ebf2ca42c26f6f3e8521da5695012284997.zip pfsense-31597ebf2ca42c26f6f3e8521da5695012284997.tar.gz |
Fix gateway lookup to use $GatewaysList array
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/filter.inc | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 6f5c0ad..d5cae99 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1268,20 +1268,11 @@ function generate_user_filter_rule($rule) /* we're not using load balancing, just setup gateway */ if($foundlb == 0) { $gateway = $rule['gateway']; - $gw = lookup_gateway_ip_by_name($rule['gateway']); - if ($gw == false) { - if (array_key_exists($gateway, $FilterIflist)) { - $int = $FilterIflist[$gateway]['if']; - $gw = get_interface_gateway($gateway); - } else { - $gw = $gateway; - $int = guess_interface_from_ip($gw); - } - } - if (is_ipaddr($gw)) { - if (empty($int)) - $int = guess_interface_from_ip($gw); - $aline['route'] = " route-to ( {$int} {$gw} ) "; + $gateway = $rule['gateway']; + $gwip = $GatewaysList[$rule['gateway']]['gateway']; + $int = $GatewaysList[$rule['gateway']]['interface']; + if (is_ipaddr($gwip)) { + $aline['route'] = " route-to ( {$int} {$gwip} ) "; } else log_error("Could not find gateway({$rule['gateway']}) for rule {$rule['descr']} - {$rule['interface']}."); } |