diff options
Diffstat (limited to 'lib/Vyatta/DstNatRule.pm')
-rw-r--r-- | lib/Vyatta/DstNatRule.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Vyatta/DstNatRule.pm b/lib/Vyatta/DstNatRule.pm index b8145cc..627fc16 100644 --- a/lib/Vyatta/DstNatRule.pm +++ b/lib/Vyatta/DstNatRule.pm @@ -157,12 +157,14 @@ sub rule_str { if (defined($self->{_proto})) { my $str = $self->{_proto}; + my $negate =""; + $negate = "!" if (m/^\!(.*)$/); $str =~ s/^\!(.*)$/ $1/; if ($str eq 'tcp_udp') { $tcp_and_udp = 1; $rule_str .= " -p tcp "; # we'll add the '-p udp' to 2nd rule later } else { - $rule_str .= " ! -p $str "; + $rule_str .= " $negate -p $str "; } } |