]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
network-list: summarize: Break when we exhausted the network range
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Mar 2022 14:48:12 +0000 (14:48 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 7 Mar 2022 14:48:12 +0000 (14:48 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/network-list.c

index f9552d62754fb34a5019471beeb97e15913b2c32..9f51965edb64f3b9c0adf0e4d0f0b46f4d0c3f24 100644 (file)
@@ -374,6 +374,11 @@ int loc_network_list_summarize(struct loc_ctx* ctx,
 
                // The next network starts right after this one
                start = *loc_network_get_last_address(network);
+
+               // If we have reached the end of possible IP addresses, we stop
+               if (loc_address_all_ones(&start))
+                       break;
+
                loc_address_increment(&start);
        }