From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] BUG12479: Copied NAT rule in Firewall displays incorrect source Port Date: Mon, 22 Mar 2021 14:11:45 +0000 Message-ID: <86C5F09D-463A-4D43-A8D0-DECE780140E8@ipfire.org> In-Reply-To: <20210319173219.13692-1-alexander.marx@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1601629610231704797==" List-Id: --===============1601629610231704797== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello, Why did this need changing? If I want to copy a rule, do I not want to copy it exactly the same way? -Michael > On 19 Mar 2021, at 17:32, Alexander Marx wrot= e: >=20 > Fixes: #12479 >=20 > When copying a NAT rule in the firewall the existing sourceport is copied, = too. > This Fix deletes the sourceport from a copied NAT rule. After Saving, the c= orrect port is used. >=20 > Signed-off-by: Alexander Marx > --- > html/cgi-bin/firewall.cgi | 5 +++++ > 1 file changed, 5 insertions(+) >=20 > diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi > index 1483e779f..532f99f91 100644 > --- a/html/cgi-bin/firewall.cgi > +++ b/html/cgi-bin/firewall.cgi > @@ -1552,6 +1552,11 @@ sub newrule > $fwdfwsettings{'USE_NAT'} =3D $hash{$key}[28]; > $fwdfwsettings{'nat'} =3D $hash{$key}[31]; #changed order > $fwdfwsettings{$fwdfwsettings{'nat'}} =3D $hash{$key}[29]; > + #Fix BUG 12479 > + #When copying a DNAT Rule, the sourceport has to be empty at this poin= t. > + if($hash{$key}[14] eq 'cust_srv' and $hash{$key}[31] eq 'dnat'){ > + $hash{$key}[30] =3D ''; > + } > $fwdfwsettings{'dnatport'} =3D $hash{$key}[30]; > $fwdfwsettings{'LIMIT_CON_CON'} =3D $hash{$key}[32]; > $fwdfwsettings{'concon'} =3D $hash{$key}[33]; > --=20 > 2.25.1 >=20 --===============1601629610231704797==--