]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
rules.pl: Call the customsrvgrp loader in case a set should be loaded.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 22 Apr 2023 07:45:27 +0000 (09:45 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sat, 22 Apr 2023 07:45:27 +0000 (09:45 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
config/firewall/rules.pl

index efe28cffc53ea60fd6d4b0c7782b5c7bdc74e955..01b9ec7f170cd07dba240a9e83f8cc0dce1f3621 100644 (file)
@@ -895,7 +895,24 @@ sub get_protocol_options {
                                }
 
                        } elsif ($dst_ports_mode eq "cust_srvgrp") {
-                               push(@options, &fwlib::get_srvgrp_port($dst_ports, uc($protocol)));
+                               # Convert the protcol into upper case format.
+                               my $uc_proto = uc($protocol);
+
+                               my $portoptions = &fwlib::get_srvgrp_port($dst_ports, $uc_proto);
+
+                               # Call function to load the port set.
+                               if($portoptions =~ /-m set/) {
+                                       # Generate the set name.
+                                       my $setname = "$dst_ports" . "_" . "$uc_proto";
+
+                                       # Dynamically register the setloader for the setname.
+                                       &register_set_loader("load_customsrvgrp", "$setname");
+
+                                       # Call functio to load the set.
+                                       &load_set($setname);
+                               }
+
+                               push(@options, $portoptions);
                        }
                }
        }