[bind10-dev] Solaris doesn't honor IPV6_USE_MIN_MTU?

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Mon Feb 27 23:24:27 UTC 2012


Build/testbot on our Solaris machine fails for a test about IPV6_USE_MIN_MTU:
http://git.bind10.isc.org/~tester/builder//BIND10/20120227213155-Solaris10-sparc-Sunstudio/logs/unittests.out

This is strange: setsockopt(IPV6_USE_MIN_MTU) succeeded, but
getsockopt(IPV6_USE_MIN_MTU) indicated the option is still disabled.

I've written a small check program (copied below) and actually
confirmed it indeed didn't fragment packets at 1280 octets.

Is it a known problem?  Is there any workaround?

---
JINMEI, Tatuya

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

#include <netdb.h>
#include <cassert>
#include <iostream>

using namespace std;

int
main(int argc, char* argv[]) {
    if (argc < 2) {
        cerr << "specify an IPv6 address in command line" << endl;
        return (1);
    }

    struct addrinfo hints, *res;

    memset(&hints, 0, sizeof(hints));
    hints.ai_family = AF_INET6;
    hints.ai_socktype = SOCK_DGRAM;
    hints.ai_protocol = IPPROTO_UDP;
    hints.ai_flags = AI_NUMERICHOST | AI_NUMERICSERV;
    const int error =  getaddrinfo(argv[1], "53535", &hints, &res);
    assert(error == 0);

    const int s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
    assert(s != -1);

    int on = 1;
    assert(setsockopt(s, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &on, sizeof(on))
           == 0);
    socklen_t optlen = sizeof(on);
    assert(getsockopt(s, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &on, &optlen) == 0);
    cout << "IPV6_USE_MIN_MTU: " << on << endl;

    char buf[1500];
    assert(sendto(s, buf, sizeof(buf), 0, res->ai_addr, res->ai_addrlen)
           == sizeof(buf));

    return (0);
}


More information about the bind10-dev mailing list