]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
networks: Test if we can add localhost (IPv6)
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Oct 2020 13:43:21 +0000 (13:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 21 Oct 2020 13:43:21 +0000 (13:43 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/test-network.c

index 85eca000d5e36a92bf5fbbdff584057eebd372c2..8c7e898f49a69a3ab8bedc19bf85e936217b1e4d 100644 (file)
@@ -175,6 +175,13 @@ int main(int argc, char** argv) {
                exit(EXIT_FAILURE);
        }
 
+       // Try adding localhost
+       err = loc_writer_add_network(writer, &network, "::1/128");
+       if (err != -EINVAL) {
+               fprintf(stderr, "It was possible to add localhost (::1/128): %d\n", err);
+               exit(EXIT_FAILURE);
+       }
+
        FILE* f = tmpfile();
        if (!f) {
                fprintf(stderr, "Could not open file for writing: %s\n", strerror(errno));