diff options
author | Daniil Baturin <daniil@baturin.org> | 2019-03-23 17:00:10 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2019-03-23 17:00:10 +0100 |
commit | 683d3cb328ce371748567e1e2354cd0c82a16966 (patch) | |
tree | bd2a055dc7cf48b60034999d8834e13371e277a7 | |
parent | 98ce64bc3c73118c8e909173da460501ca6cabf1 (diff) | |
download | vyatta-nat-683d3cb328ce371748567e1e2354cd0c82a16966.tar.gz vyatta-nat-683d3cb328ce371748567e1e2354cd0c82a16966.zip |
T1312: allow NAT rules with networks of different size.
-rw-r--r-- | lib/Vyatta/DstNatRule.pm | 7 | ||||
-rw-r--r-- | lib/Vyatta/SrcNatRule.pm | 5 |
2 files changed, 1 insertions, 11 deletions
diff --git a/lib/Vyatta/DstNatRule.pm b/lib/Vyatta/DstNatRule.pm index bd54306..aa419e5 100644 --- a/lib/Vyatta/DstNatRule.pm +++ b/lib/Vyatta/DstNatRule.pm @@ -265,7 +265,7 @@ sub rule_str { if ($use_netmap) { if (!defined $dst->{_network}){ - return ("\ndestination address needs to be defined as a subnet with the same network prefix as translation address" . + return ("\ndestination address needs to be defined" . "\nwhen translation address is defined with a prefix for static network mapping " , undef); } @@ -274,11 +274,6 @@ sub rule_str { my $dst_addr_mask = $dst->{_network}; $inside_addr_mask =~ s/.+\///; $dst_addr_mask =~ s/.+\///; - if (!($inside_addr_mask == $dst_addr_mask)) { - return ("\ndestination address should be a subnet with the same network prefix as translation address" . - "\nwhen translation address is defined with a prefix for static network mapping" - , undef); - } if ($dst->{_network} =~ /\!/) { return ("\ncannot define a negated destination address when translation address" . diff --git a/lib/Vyatta/SrcNatRule.pm b/lib/Vyatta/SrcNatRule.pm index 52227a5..dfb6f28 100644 --- a/lib/Vyatta/SrcNatRule.pm +++ b/lib/Vyatta/SrcNatRule.pm @@ -305,11 +305,6 @@ sub rule_str { $outside_addr_mask =~ s/.+\///; $src_addr_mask =~ s/.+\///; - if (!($outside_addr_mask == $src_addr_mask)) { - return ("\nsource address should be a subnet with the same network prefix as translation address" . - "\nwhen translation address is defined with a prefix for static network mapping " - , undef); - } if ($src->{_network} =~ /\!/) { return ("\ncannot define a negated source address when translation address" . |