]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
ipblocklist-functions.pl: Allow downloading empty blocklists
authorStefan Schantl <stefan.schantl@ipfire.org>
Sat, 24 May 2025 08:14:36 +0000 (10:14 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 25 May 2025 11:58:04 +0000 (11:58 +0000)
Some blocklist providers does serve blocklists for current events or
with very limited updates. Therefore there is a chance such a blocklist
could be empty for a certain time.

This patch allows to replace an existing filled blocklist by an empty
one and vice versa.

Fixes #13804.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/cfgroot/ipblocklist-functions.pl

index 665dadb4cbe6b46747260132c4b80f326a3e1234..b2d0a1a49eed075193d311931138a9292ab33dc7 100644 (file)
@@ -91,8 +91,6 @@ sub get_ipset_db_file($) {
 ##   nothing - On success
 ##   not_modified - In case the servers responds with "Not modified" (304)
 ##   dl_error - If the requested blocklist could not be downloaded.
-##   empty_list - The downloaded blocklist is empty, or the parser was not able to parse
-##                it correctly.
 #
 sub download_and_create_blocklist($) {
        my ($list) = @_;
@@ -226,13 +224,6 @@ sub download_and_create_blocklist($) {
                push(@blocklist, $address);
        }
 
-       # Check if the content could be parsed correctly and the blocklist
-       # contains at least one item.
-       unless(@blocklist) {
-               # No entries - exit and return "empty_list".
-               return "empty_list";
-       }
-
        # Get amount of entries in the blocklist array.
        my $list_entries = scalar(@blocklist);