From 683d3cb328ce371748567e1e2354cd0c82a16966 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 23 Mar 2019 17:00:10 +0100 Subject: T1312: allow NAT rules with networks of different size. --- lib/Vyatta/DstNatRule.pm | 7 +------ lib/Vyatta/SrcNatRule.pm | 5 ----- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'lib/Vyatta') 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" . -- cgit v1.2.3