diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-09 23:13:54 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-09 23:13:54 +0000 |
commit | d56b42b889bee436466cbec0a985dc2cb05d4a4d (patch) | |
tree | a4434a8fe8d3867899ba7a74726db1481be7be8e /etc | |
parent | 2e56710cc4d4af96740f4c872f9341894226c697 (diff) | |
download | pfsense-d56b42b889bee436466cbec0a985dc2cb05d4a4d.zip pfsense-d56b42b889bee436466cbec0a985dc2cb05d4a4d.tar.gz |
Resolve aliases.
Ticket #464
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/filter.inc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc index d27d60a..36d7a65 100644 --- a/etc/inc/filter.inc +++ b/etc/inc/filter.inc @@ -1079,10 +1079,20 @@ function filter_nat_rules_generate() { $natrules .= "# NAT Inbound Redircts\n"; foreach ($config['nat']['rule'] as $rule) { - $extport = explode("-", $rule['external-port']); - $target = alias_expand_host($rule['target']); - $localport = $rule['local-port']; + /* if item is an alias, expand */ + if(alias_expand($rule['external-port'])) + $extport = alias_expand($rule['external-port']); + else + $extport = explode("-", $rule['external-port']); + + /* if item is an alias, expand */ + if(alias_expand($rule['local-port'])) + $localport = alias_expand($rule['local-port']); + else + $localport = $rule['local-port']; + $target = alias_expand_host($rule['target']); + if (!$target) continue; /* unresolvable alias */ |