diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-01 19:13:20 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-01 19:13:20 -0800 |
commit | 4658f6263d756066712e5c0be11a21e5dcc9d774 (patch) | |
tree | 17f4ca0e6c1f61b45c0217be7c9ecee79d2ce87e /scripts | |
parent | df59479b92a9ca1d20c6cebcd83b135f2aaf7761 (diff) | |
download | vyatta-cfg-firewall-4658f6263d756066712e5c0be11a21e5dcc9d774.tar.gz vyatta-cfg-firewall-4658f6263d756066712e5c0be11a21e5dcc9d774.zip |
fix for bug 2528: collapse source/destination "address" and "network".
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/firewall/VyattaIpTablesAddressFilter.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/firewall/VyattaIpTablesAddressFilter.pm b/scripts/firewall/VyattaIpTablesAddressFilter.pm index 4747e5e..aa65854 100644 --- a/scripts/firewall/VyattaIpTablesAddressFilter.pm +++ b/scripts/firewall/VyattaIpTablesAddressFilter.pm @@ -47,8 +47,12 @@ sub setup { # setup address filter nodes $self->{_range_start} = $config->returnValue("range start"); $self->{_range_stop} = $config->returnValue("range stop"); - $self->{_network} = $config->returnValue("network"); $self->{_address} = $config->returnValue("address"); + $self->{_network} = undef; + if (defined($self->{_address}) && ($self->{_address} =~ /\//)) { + $self->{_network} = $self->{_address}; + $self->{_address} = undef; + } my @tmp = $config->returnValues("port-number"); $self->{_portnumber} = [ @tmp ]; @tmp = $config->returnValues("port-name"); @@ -74,8 +78,12 @@ sub setupOrig { # setup address filter nodes $self->{_range_start} = $config->returnOrigValue("range start"); $self->{_range_stop} = $config->returnOrigValue("range stop"); - $self->{_network} = $config->returnOrigValue("network"); $self->{_address} = $config->returnOrigValue("address"); + $self->{_network} = undef; + if (defined($self->{_address}) && ($self->{_address} =~ /\//)) { + $self->{_network} = $self->{_address}; + $self->{_address} = undef; + } my @tmp = $config->returnOrigValues("port-number"); $self->{_portnumber} = [ @tmp ]; @tmp = $config->returnOrigValues("port-name"); |