-
- # Replace --dport with the translated one.
- my @new_nat_options = ();
- my $skip_count = 0;
- foreach my $option (@nat_options) {
- next if ($skip_count-- > 0);
-
- if ($option eq "--dport") {
- push(@new_nat_options, ("--dport", $dnat_port));
- $skip_count = 1;
- next;
- }
-
- push(@new_nat_options, $option);
- }
- @nat_options = @new_nat_options;