Allow port variables as the server port in DNAT rules

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2017-08-16 15:36:18 -07:00
parent d8eca457de
commit 5a9f179e25
No known key found for this signature in database
GPG Key ID: 96E6B3F2423A4D10

View File

@ -4832,7 +4832,7 @@ sub do_proto( $$$;$ )
$multiport = 1; $multiport = 1;
} else { } else {
fatal_error "Missing DEST PORT" unless supplied $ports; fatal_error "Missing DEST PORT" unless supplied $ports;
$ports = validate_portpair $pname , $ports; $ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
$output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " ); $output .= ( $srcndst ? "-m multiport ${invert}--ports ${ports} " : "${invert}--dport ${ports} " );
} }
} }
@ -5039,7 +5039,7 @@ sub do_iproto( $$$ )
$multiport = 1; $multiport = 1;
} else { } else {
fatal_error "Missing DEST PORT" unless supplied $ports; fatal_error "Missing DEST PORT" unless supplied $ports;
$ports = validate_portpair $pname , $ports; $ports = validate_portpair $pname , $ports unless $ports =~ /^\$/;
if ( $srcndst ) { if ( $srcndst ) {
push @output, multiport => "${invert}--ports ${ports}"; push @output, multiport => "${invert}--ports ${ports}";