I'm wondering how one is supposed to test for INET6 support in the
kernel.  Currently a few places do it in a somewhat bogus fashion
like this:

    s = socket(AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
    if (s == -1)
        have_v6 = 0;
    else
        close(s); 

But this is wrong because unless errno is EPROTONOSUPPORT this
might mean something else is horribly wrong.  There's also at least
one place that happens to check for EPROTONOSUPPORT, but it also
erroniously checks for EPFNOSUPPORT and EAFNOSUPPORT which are
actually the result one would get if they passed invalid arguments
to socket(2).

So what's the right thing to do here?

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
Instead of asking why a piece of software is using "1970s technology,"
start asking why software is ignoring 30 years of accumulated wisdom.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to