diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-12-14 16:21:44 +0100 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-12-14 16:21:44 +0100 |
commit | 0a32bc9b37c641b3ee0b7997b747d4a5c94fdd1c (patch) | |
tree | 07a4dcdbbd169a39e5d58f0f039fb1a886166a77 | |
parent | 9ff8c29942d8f23b48fa838a611cb964cce15b2f (diff) | |
download | pfsense-0a32bc9b37c641b3ee0b7997b747d4a5c94fdd1c.zip pfsense-0a32bc9b37c641b3ee0b7997b747d4a5c94fdd1c.tar.gz |
Make sure that if we are passed a IP address but do not have the interface yet, which can happen when
rules are upgraded from 1.2, then find the interface and carry on.
This fixes upgrades where rules might direct traffic out a specific WAN.
-rw-r--r-- | etc/inc/filter.inc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 50f78b8..eb3941e 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1426,10 +1426,18 @@ function filter_generate_user_rule($rule) $gwip = $gateway; $int = guess_interface_from_ip($gwip); } - if (is_ipaddr($gwip) && ($int <> "")) - $aline['route'] = " route-to ( {$int} {$gwip} ) "; - else + if (is_ipaddr($gwip)) { + if($int == "") { + $int = guess_interface_from_ip($gwip); + } + if($int <> "") { + $aline['route'] = " route-to ( {$int} {$gwip} ) "; + } else { + log_error("Could not find gateway ({$rule['gateway']}) for rule {$rule['descr']} - {$rule['interface']}."); + } + } else { log_error("Could not find gateway ({$rule['gateway']}) for rule {$rule['descr']} - {$rule['interface']}."); + } } } |