summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-04-19 01:18:07 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-04-19 01:18:07 +0000
commitbd7a3f8cefeab7306f917dd2ad78232f05333318 (patch)
tree585fce17defea1b045726f04724806e0efd697eb /etc
parent832ad79ef55b7be9dfb8bb3ef516160953de2169 (diff)
downloadpfsense-bd7a3f8cefeab7306f917dd2ad78232f05333318.zip
pfsense-bd7a3f8cefeab7306f917dd2ad78232f05333318.tar.gz
MFC 11598
Only use route-to if the discovered gateway is a real IP
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/filter.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index bc0f82b..665c97f 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -1258,16 +1258,20 @@ function generate_user_filter_rule($rule, $ngcounter) {
if(is_file("{$g['tmp_path']}/{$int}_router")) {
$gatewayip = file_get_contents("{$g['tmp_path']}/{$int}_router");
$gatewayip = rtrim($gatewayip);
- $line .= " route-to ( {$int} {$gatewayip} ) ";
+ if (is_ipaddr($gatewayip)) {
+ $line .= " route-to ( {$int} {$gatewayip} ) ";
+ }
} else {
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} ) ";
+ if(is_ipaddr($rule['gateway'])) {
+ $gatewayip = $rule['gateway'];
+ $int = guess_interface_from_ip($gatewayip);
+ $line .= " route-to ( " . guess_interface_from_ip($rule['gateway']) . " {$rule['gateway']} ) ";
+ }
}
}
}
OpenPOWER on IntegriCloud