diff options
author | Bill Marquette <billm@pfsense.org> | 2005-09-10 01:11:14 +0000 |
---|---|---|
committer | Bill Marquette <billm@pfsense.org> | 2005-09-10 01:11:14 +0000 |
commit | b4c39102fbfc889248941a2b998f102fdd649e53 (patch) | |
tree | 3915e07c428fdb12fd2f6c153848de9b722c28b5 | |
parent | e9832b417ced700fc9338d72f3649d1a8c566b26 (diff) | |
download | pfsense-b4c39102fbfc889248941a2b998f102fdd649e53.zip pfsense-b4c39102fbfc889248941a2b998f102fdd649e53.tar.gz |
(#478) Look at the real interface, trim newline from gateway IP file
-rw-r--r-- | etc/inc/filter.inc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 36d7a65..fc52b46 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1438,18 +1438,20 @@ function generate_user_filter_rule($rule, $ngcounter) { * from /tmp/router_bleh.router */ if(in_array($gateway, $ifdescrs)==true) { - if(is_file("{$g["tmp_path"]}/{$gateway}_router")) { - $gatewayip = file_get_contents("{$g["tmp_path"]}/{$gateway}_router"); + $int=filter_opt_interface_to_real($gateway); + if(is_file("{$g["tmp_path"]}/{$int}_router")) { + $gatewayip = file_get_contents("{$g["tmp_path"]}/{$int}_router"); + $line .= " route-to ( " . $int . " " . rtrim($gatewayip) . " ) "; } else { - log_error("Could not find {$g["tmp_path"]}/{$gateway}_router. Needed for dhcp gateway information"); + log_error("Could not find {$g["tmp_path"]}/{$int}_router. Needed for dhcp gateway information"); continue; } } else { /* user picked a real gateway ip */ $gatewayip = $rule['gateway']; + $int = guess_interface_from_ip($gatewayip); + $line .= " route-to ( " . $int . " " . $gatewayip . " ) "; } - $int = guess_interface_from_ip($gatewayip); - $line .= " route-to (" . $int . " " . $gatewayip . ") "; } } |