>>>>> On Wed, 18 Sep 2002 21:44:33 -0400 (EDT), 
>>>>> Trish Lynch <[EMAIL PROTECTED]> said:

> sysctl net.inet6.ip6.v6only=0

This should also work:

*** foo.c.orig  Thu Sep 19 12:05:04 2002
--- foo.c       Thu Sep 19 12:05:56 2002
***************
*** 14,19 ****
--- 14,20 ----
    struct sockaddr_in6 addr;
    struct hostent *hostinfo;
    int sock;
+   int off;
  
    memset(&addr, 0, sizeof(struct sockaddr_in6));
  
***************
*** 30,35 ****
--- 31,40 ----
    addr.sin6_port = htons((u_short)5555);
  
    sock = socket(AF_INET6, SOCK_STREAM, 0);
+ #ifdef IPV6_V6ONLY
+   off = 0;
+   setsockopt(sock, IPPROTO_IPV6, &off, sizeof(off));
+ #endif
    bind(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in6));
    listen(sock, 5);
  
I'd recommend this approach rather than to use sysctl, particularly
for new applications built from the scratch, because we can control
the policy per-socket basis.

You may have to note that draft-ietf-ipngwg-rfc2553bis-06.txt
specifies 0 as the default value of the option while FreeBSD does not
follow the specification.  Even though the clear specification, there
is a certain amount of stack developers who have a different opinion
on this and intentionally reverse the default.  So, the safest way is
to set the value explicitly.

                                        JINMEI, Tatuya
                                        Communication Platform Lab.
                                        Corporate R&D Center, Toshiba Corp.
                                        [EMAIL PROTECTED]

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

Reply via email to