diff options
-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 . ") "; } } |