diff options
author | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-04 06:04:09 -0700 |
---|---|---|
committer | Erik Fonnesbeck <efonnes@gmail.com> | 2011-02-04 06:04:09 -0700 |
commit | 9f1e3b2b33ced0cba1abc36387abd1c134e5216f (patch) | |
tree | 64dec861aa5570fb957318d03d8e39c7c6b39a87 /etc/inc | |
parent | b5efd82a93eb7f73dd9119b2669c9dca704b430f (diff) | |
download | pfsense-9f1e3b2b33ced0cba1abc36387abd1c134e5216f.zip pfsense-9f1e3b2b33ced0cba1abc36387abd1c134e5216f.tar.gz |
Add backend support for aliases on source and destination address of outbound NAT rules.
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/filter.inc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index 47b5cda..6cb9f1f 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1231,11 +1231,14 @@ function filter_nat_rules_generate() { if(is_array($config['nat']['advancedoutbound']['rule'])) { foreach ($config['nat']['advancedoutbound']['rule'] as $obent) { update_filter_reload_status("Creating advanced outbound rule {$obent['descr']}"); - $src = $obent['source']['network']; - if(isset($obent['destination']['not']) && !isset($obent['destination']['any'])) - $dst = "!" . $obent['destination']['address']; - else + $src = alias_expand($obent['source']['network']); + if(!$src) + $src = $obent['source']['network']; + $dst = alias_expand($obent['destination']['address']); + if(!$dst) $dst = $obent['destination']['address']; + if(isset($obent['destination']['not']) && !isset($obent['destination']['any'])) + $dst = "!" . $dst; if(!$obent['interface']) $natif = "wan"; else |