networking · beginner · ~15 min

IPv6 loopback?

Recognise the IPv6 loopback address.

Challenge

Implement int is_ipv6_loopback(const char *addr) returning 1 if addr is exactly "::1", else 0.

Starter code

#include <string.h>

int is_ipv6_loopback(const char *addr) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.