]> git.ipfire.org Git - location/libloc.git/commitdiff
database: Return something when no filter criteria is configured
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Mar 2022 12:04:44 +0000 (12:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 5 Mar 2022 12:04:44 +0000 (12:04 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/database.c

index ce3fe3d9f92e7eeccc790c5aeb5014b0095ce23d..e5f779d72c2fb1982fe0a4d76cba345379e5d3a4 100644 (file)
@@ -1168,6 +1168,10 @@ static int loc_database_enumerator_match_network(
                return 0;
        }
 
+       // Match if no filter criteria is configured
+       if (!enumerator->countries && !enumerator->asns && !enumerator->flags)
+               return 1;
+
        // Check if the country code matches
        if (enumerator->countries && !loc_country_list_empty(enumerator->countries)) {
                const char* country_code = loc_network_get_country_code(network);