]> git.ipfire.org Git - location/libloc.git/commitdiff
network: Do not execute with an error when the excluded result will be empty
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Nov 2020 15:13:08 +0000 (15:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 25 Nov 2020 15:13:08 +0000 (15:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network.c

index 66b460ffa447064aee649e14b23d6b7cefd22620..9aa802f5108ba77919d2a2e7df0ba41dffff2a79 100644 (file)
@@ -595,14 +595,16 @@ static int __loc_network_exclude_to_list(struct loc_network* self,
        if (!loc_network_is_subnet(self, other)) {
                DEBUG(self->ctx, "Network %p is not contained in network %p\n", other, self);
 
-               return 1;
+               // Exit silently
+               return 0;
        }
 
        // We cannot perform this operation if both networks equal
        if (loc_network_cmp(self, other) == 0) {
                DEBUG(self->ctx, "Networks %p and %p are equal\n", self, other);
 
-               return 1;
+               // Exit silently
+               return 0;
        }
 
        return __loc_network_exclude(self, other, list);