summaryrefslogtreecommitdiffstats
path: root/etc/inc/filter.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-07-12 12:01:20 +0000
committerErmal Luçi <eri@pfsense.org>2008-07-12 12:01:20 +0000
commitfaa6dd5be6c64ce11fd35579f6094d98ceddede0 (patch)
tree86153fd4e41d8a95cbad2b87348007e0110742fe /etc/inc/filter.inc
parenta93e56c58af2611650d1f97190ffe54782479423 (diff)
downloadpfsense-faa6dd5be6c64ce11fd35579f6094d98ceddede0.zip
pfsense-faa6dd5be6c64ce11fd35579f6094d98ceddede0.tar.gz
Do not build unparsable rulesets to avoid rule errors.
Diffstat (limited to 'etc/inc/filter.inc')
-rw-r--r--etc/inc/filter.inc10
1 files changed, 7 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index 01b9fd8..be07d56 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -3060,9 +3060,13 @@ EOD;
$gateway = lookup_gateway_ip_by_name($config['interfaces'][$ifr]['gateway']);
$interface = convert_friendly_interface_to_real_interface_name($iface);
-
- $route_to = " route-to ( $interface $gateway ) ";
- $reply_to = " reply-to ( $interface $gateway ) ";
+ if (!is_ipaddr($gateway) || empty($interface)) {
+ $route_to = " ";
+ $reply_to = " ";
+ } else {
+ $route_to = " route-to ( $interface $gateway ) ";
+ $reply_to = " reply-to ( $interface $gateway ) ";
+ }
/* Another conversion. Why? */
$ifalias = convert_friendly_interface_to_friendly_descr($ifr);
OpenPOWER on IntegriCloud