diff options
author | Merijn Evertse <merijn@trans-ix.nl> | 2019-01-29 14:46:56 +0100 |
---|---|---|
committer | Merijn Evertse <merijn@trans-ix.nl> | 2019-01-29 14:46:56 +0100 |
commit | 82245fbfc8c8b0c47508cb67d6a5b91b1b9ce5e1 (patch) | |
tree | 0aa009779956bb81afcfde439fddd97641f32bba /lib | |
parent | 6f79779ecf9ada95a13c15997810ca5c21ce7db3 (diff) | |
parent | 0b58083b29bff5bb4a2b16354a77a2794be7cc07 (diff) | |
download | vyatta-nat-82245fbfc8c8b0c47508cb67d6a5b91b1b9ce5e1.tar.gz vyatta-nat-82245fbfc8c8b0c47508cb67d6a5b91b1b9ce5e1.zip |
Merge branch 'current' of https://github.com/mevertse/vyatta-nat into HEAD
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VyOS/Nptv6Rule.pm | 7 | ||||
-rw-r--r-- | lib/Vyatta/DstNatRule.pm | 6 | ||||
-rw-r--r-- | lib/Vyatta/SrcNatRule.pm | 8 |
3 files changed, 12 insertions, 9 deletions
diff --git a/lib/VyOS/Nptv6Rule.pm b/lib/VyOS/Nptv6Rule.pm index f9e7632..d753e93 100644 --- a/lib/VyOS/Nptv6Rule.pm +++ b/lib/VyOS/Nptv6Rule.pm @@ -58,10 +58,9 @@ sub setup { $config->setLevel("$level"); $self->{_rule_number} = $config->returnParent(".."); - $self->{_inside_if} = $config->returnValue("inside-interface"); - $self->{_outside_if} = $config->returnValue("outside-interface"); - $self->{_inside_pfx} = $config->returnValue("inside-prefix"); - $self->{_outside_pfx} = $config->returnValue("outside-prefix"); + $self->{_outside_if} = $config->returnValue("outbound-interface"); + $self->{_inside_pfx} = $config->returnValue("source prefix"); + $self->{_outside_pfx} = $config->returnValue("translation prefix"); $self->{_disable} = $config->exists("disable"); diff --git a/lib/Vyatta/DstNatRule.pm b/lib/Vyatta/DstNatRule.pm index e2aa483..bd54306 100644 --- a/lib/Vyatta/DstNatRule.pm +++ b/lib/Vyatta/DstNatRule.pm @@ -158,8 +158,10 @@ sub rule_str { if (defined($self->{_proto})) { my $str = $self->{_proto}; my $negate =""; - $negate = "!" if (m/^\!(.*)$/); - $str =~ s/^\!(.*)$/ $1/; + if ($str =~ /^\!(.*)$/) { + $str = $1; + $negate = "!"; + } if ($str eq 'tcp_udp') { $tcp_and_udp = 1; $rule_str .= " -p tcp "; # we'll add the '-p udp' to 2nd rule later diff --git a/lib/Vyatta/SrcNatRule.pm b/lib/Vyatta/SrcNatRule.pm index 89623a4..52227a5 100644 --- a/lib/Vyatta/SrcNatRule.pm +++ b/lib/Vyatta/SrcNatRule.pm @@ -176,9 +176,11 @@ sub rule_str { if (defined($self->{_proto})) { my $str = $self->{_proto}; - my $negate =""; - $negate = "!" if (m/^\!(.*)$/); - $str =~ s/^\!(.*)$/ $1/; + my $negate = ""; + if ($str =~ /^\!(.*)$/) { + $str = $1; + $negate = "!"; + } if ($str eq 'tcp_udp') { $tcp_and_udp = 1; $rule_str .= " -p tcp "; # we'll add the '-p udp' to 2nd rule later |