From: Stefan Schantl Date: Sat, 22 Apr 2023 07:45:27 +0000 (+0200) Subject: rules.pl: Call the customsrvgrp loader in case a set should be loaded. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=31670891c65007264785837463af3ab55b9208b4;p=people%2Fstevee%2Fipfire-2.x.git rules.pl: Call the customsrvgrp loader in case a set should be loaded. Signed-off-by: Stefan Schantl --- diff --git a/config/firewall/rules.pl b/config/firewall/rules.pl index efe28cffc5..01b9ec7f17 100644 --- a/config/firewall/rules.pl +++ b/config/firewall/rules.pl @@ -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. + ®ister_set_loader("load_customsrvgrp", "$setname"); + + # Call functio to load the set. + &load_set($setname); + } + + push(@options, $portoptions); } } }