]> git.ipfire.org Git - people/ms/libloc.git/blobdiff - src/test-network.c
networks: Test if we can add localhost (IPv6)
[people/ms/libloc.git] / 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));