Handle DNAT with no port correctly.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2013-03-01 07:58:58 -08:00
parent 252dd9b676
commit 8960f72532
2 changed files with 12 additions and 2 deletions

View File

@ -634,7 +634,7 @@ sub handle_nat_rule( $$$$$$$$$$$$ ) {
#
# Isolate server port
#
if ( $dest =~ /^(.*)(?::(.+))$/ ) {
if ( ( $family == F_IPV4 && $dest =~ /^(.*)(?::(.+))$/ ) || ( $family == F_IPV6 && $dest =~ /^\[(.*)]:(.+)$/ ) ) {
#
# Server IP and Port
#

View File

@ -882,7 +882,7 @@
<variablelist>
<varlistentry>
<term>Example:</term>
<term>Example 1:</term>
<listitem>
<para><emphasis
@ -891,6 +891,16 @@
on port 3128.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Example 2:</term>
<listitem>
<para><emphasis role="bold">loc:[]:3128</emphasis> specifies
that the destination port should be changed to 3128 but the IP
address should remain the same.</para>
</listitem>
</varlistentry>
</variablelist>
<para>The <emphasis>port</emphasis> may be specified as a service