]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/firewall/rules.pl
rules.pl: Fix creating rules for location based groups.
[ipfire-2.x.git] / config / firewall / rules.pl
index d713049867f4ee7a9cb198cc85cf8225dd7eadf5..19dc7a6d15a247403b399f9591d303552313d12a 100644 (file)
@@ -411,8 +411,9 @@ sub buildrules {
                                        if ($source =~ /mac/) {
                                                push(@source_options, $source);
                                        } elsif ($source =~ /-m set/) {
-                                               # Grab location code from hash.
-                                               my $loc_src = $$hash{$key}[4];
+                                               # Split given arguments into single chunks to
+                                               # obtain the set name.
+                                               my ($a, $b, $c, $loc_src, $e) = split(/ /, $source);
 
                                                # Call function to load the networks list for this country.
                                                &ipset_restore($loc_src);
@@ -425,8 +426,9 @@ sub buildrules {
                                        # Prepare destination options.
                                        my @destination_options = ();
                                        if ($destination =~ /-m set/) {
-                                               # Grab location code from hash.
-                                               my $loc_dst = $$hash{$key}[6];
+                                               # Split given arguments into single chunks to
+                                               # obtain the set name.
+                                               my ($a, $b, $c, $loc_dst, $e) = split(/ /, $destination);
 
                                                # Call function to load the networks list for this country.
                                                &ipset_restore($loc_dst);