Hacker News new | ask | show | jobs
by bigstrat2003 361 days ago
IPv6 is not actually hard to implement or maintain. A lot of people have repeated that meme, but it isn't true at all.
1 comments

Okay, then please reimplement the equivalent of the following code to work with both IPv4 and IPv6:

    int fd = socket(AF_INET, SOCK_STREAM, 0);
    struct sockaddr_in addr = { .sin_family = AF_INET, .sin_port = htons(1234) };
    addr.sin_addr.s_addr = htonl(INADDR_ANY);
    bind(fd, (struct sockaddr*)&addr, sizeof(addr));
    listen(fd, 128);
    int client;
    while (client = accept(fd, 0, 0)) {
        // ...
    }
I don't think anyone was talking about the difficulty of implementing IPv6 in software. I certainly wasn't. I meant the difficulty of implementing it as a network admin, which is not really hard.