]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
BUG12301: Iptables “host/network ‘none’ not found”
authorAlexander Marx <alexander.marx@ipfire.org>
Mon, 12 Apr 2021 06:05:45 +0000 (08:05 +0200)
committerPeter Müller <peter.mueller@ipfire.org>
Sun, 6 Feb 2022 17:18:31 +0000 (17:18 +0000)
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.
Additionally the rule is skipped when rules.pl creates rules.

There are no bootmessages with failed target "none" anymore.
Acked-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/firewall/firewall-lib.pl
html/cgi-bin/firewall.cgi

index bc0b30ca5c7b87939721e1dd3bf31f6549541f75..e7ec30ae0b337234418e5fc013c2641128a0c010 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2013 Alexander Marx <amarx@ipfire.org>                        #
+# Copyright (C) 2021 Alexander Marx <amarx@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 <=> $b} keys %customgrp) {
                        if ($customgrp{$grp}[0] eq $value) {
                                my @address = &get_address($customgrp{$grp}[3], $customgrp{$grp}[2], $type);
-
+                               next if ($address[0][0] eq 'none');
                                if (@address) {
                                        push(@addresses, @address);
                                }
index 8e17cef57630bfd73dda3fea429d0805b167f27f..1341f52095a94a4f984caacc01f5ff8a11dee20b 100644 (file)
@@ -643,7 +643,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;
                                }