BUG12301: Iptables “host/network ‘none’ not found”

Message ID 20210401125044.39919-1-alexander.marx@ipfire.org
State Superseded
Headers
Series BUG12301: Iptables “host/network ‘none’ not found” |

Commit Message

Alexander Marx April 1, 2021, 12:50 p.m. UTC
  Fixes: #12301

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.

With this patch the hint is shown again.
---
 html/cgi-bin/firewall.cgi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Michael Tremer April 1, 2021, 1:21 p.m. UTC | #1
The bug report states rules that are generated in a wrong way and could not be inserted.

This patch only changes firewall.cgi. Do we not need to have anything that skips those rules or would this case just not happen after the files have been saved again after this patch?

-Michael

> On 1 Apr 2021, at 13:50, Alexander Marx <alexander.marx@ipfire.org> wrote:
> 
> Fixes: #12301
> 
> 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.
> 
> With this patch the hint is shown again.
> ---
> html/cgi-bin/firewall.cgi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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{$hostkey}[1] eq 'mac'){
> +				if ($customgrp{$grpkey}[2] eq $customhost{$hostkey}[0] && $customgrp{$grpkey}[0] eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostkey}[1] eq 'mac'){
> 					$hint=$Lang::tr{'fwdfw hint mac'};
> 					return $hint;
> 				}
> -- 
> 2.25.1
>
  

Patch

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{$hostkey}[1] eq 'mac'){
+				if ($customgrp{$grpkey}[2] eq $customhost{$hostkey}[0] && $customgrp{$grpkey}[0] eq $fwdfwsettings{$fwdfwsettings{'grp2'}} && $customhost{$hostkey}[1] eq 'mac'){
 					$hint=$Lang::tr{'fwdfw hint mac'};
 					return $hint;
 				}