From mboxrd@z Thu Jan  1 00:00:00 1970
From: Michael Tremer <michael.tremer@ipfire.org>
To: development@lists.ipfire.org
Subject: Re: [PATCH] BUG12301: Iptables =?utf-8?q?=E2=80=9Chost/network_?=
 =?utf-8?b?4oCYbm9uZeKAmSBub3QgZm91bmTigJ0=?=
Date: Mon, 12 Apr 2021 11:23:40 +0100
Message-ID: <1B42EBFB-FEA2-4390-98D2-B183D6F99F3F@ipfire.org>
In-Reply-To: <6361de92-d39f-4d14-a11e-ad58496619aa@ipfire.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3747519323525085802=="
List-Id: <development.lists.ipfire.org>

--===============3747519323525085802==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

Hello,

> On 12 Apr 2021, at 11:23, Alexander Marx <alexander.marx(a)ipfire.org> wrot=
e:
>=20
>=20
>=20
> Am 12.04.21 um 12:18 schrieb Michael Tremer:
>> Hi,
>>=20
>>> On 12 Apr 2021, at 07:05, Alexander Marx <alexander.marx(a)ipfire.org> wr=
ote:
>>>=20
>>> Fixes: #12301
>>>=20
>>> When using hosts with MAC-addresses in a hostgroup,
>>> the rule won't be generated if those hosts are selected as target.
>>> There is a hint but due to a wrong hashparameter the hint was not shown.
>>>=20
>>> With this patch the hint is shown again.
>>> Additionally the rule is skipped when rules.pl creates rules.
>>>=20
>>> There are no bootmessages with failed target "none" anymore.
>>> ---
>>> config/firewall/firewall-lib.pl | 4 ++--
>>> html/cgi-bin/firewall.cgi       | 2 +-
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>=20
>>> diff --git a/config/firewall/firewall-lib.pl b/config/firewall/firewall-l=
ib.pl
>>> index bc0b30ca5..e7ec30ae0 100644
>>> --- a/config/firewall/firewall-lib.pl
>>> +++ b/config/firewall/firewall-lib.pl
>>> @@ -2,7 +2,7 @@
>>> #########################################################################=
######
>>> #                                                                        =
     #
>>> # IPFire.org - A linux based firewall                                    =
     #
>>> -# Copyright (C) 2013 Alexander Marx <amarx(a)ipfire.org>                =
        #
>>> +# Copyright (C) 2021 Alexander Marx <amarx(a)ipfire.org>                =
        #
>>> #                                                                        =
     #
>>> # This program is free software: you can redistribute it and/or modify   =
     #
>>> # it under the terms of the GNU General Public License as published by   =
     #
>>> @@ -315,7 +315,7 @@ sub get_addresses
>>> 		foreach my $grp (sort {$a <=3D> $b} keys %customgrp) {
>>> 			if ($customgrp{$grp}[0] eq $value) {
>>> 				my @address =3D &get_address($customgrp{$grp}[3], $customgrp{$grp}[2]=
, $type);
>>> -
>>> +				next if ($address[0][0] eq 'none');
>> A comment for these rather obscure things would not hurt, but technically =
I agree with how this is solved.
>>=20
>>=20
>>=20
>>> 				if (@address) {
>>> 					push(@addresses, @address);
>>> 				}
>>> diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
>>> index 1483e779f..b0851dd3e 100644
>>> --- a/html/cgi-bin/firewall.cgi
>>> +++ b/html/cgi-bin/firewall.cgi
>>> @@ -592,7 +592,7 @@ sub checktarget
>>> 		&General::readhasharray("$confighost", \%customhost);
>>> 		foreach my $grpkey (sort keys %customgrp){
>>> 			foreach my $hostkey (sort keys %customhost){
>>> -				if ($customgrp{$grpkey}[2] eq $customhost{$hostkey}[0] && $customgrp=
{$grpkey}[2] eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostke=
y}[1] eq 'mac'){
>>> +				if ($customgrp{$grpkey}[2] eq $customhost{$hostkey}[0] && $customgrp=
{$grpkey}[0] eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostke=
y}[1] eq 'mac'){
>> What has changed here?
> only the hashfield
>=20
> $customgrp{$grpkey}[0] (was 2 before)

Yes I saw that, but what does that change?

-Michael

P.S. Do not forget to CC the list

>=20
>>=20
>>> 					$hint=3D$Lang::tr{'fwdfw hint mac'};
>>> 					return $hint;
>>> 				}
>>> =E2=80=94
>>> 2.25.1
>>>=20
>> Best,
>> -Michael


--===============3747519323525085802==--