sendto() problem using T/TCP over IPv6

Hannes Persson mda00hpe at
Tue Mar 9 04:40:38 PST 2004


I have a problem bothering me for days now. Hope some of you have an
proposal for a solution...

I have some code working over IP4 sending T/TCP transactions. But when
switching to IP6 the sendto() complains over "Socket is not connected". 
As i said it currently working witch the usual sin but when switching to
sin6 the error occurs. The OS i am using is FreeBSD4.8.

I paste a snippet from the code:

        struct sockaddr_in6     serv;
        if ( (sockfd = socket(AF_INET6, SOCK_STREAM, 0)) < 0)
                printf("socket error");

        memset(&serv, sizeof(serv), 0);
        serv.sin6_family = AF_INET6;
        serv.sin6_port = htons(80);
        inet_pton(AF_INET6, argv[1], &serv.sin6_addr);
        if (sendto(sockfd, request,strlen(request), MSG_EOF, (struct
&serv, sizeof(serv)) != strlen(request))
        perror("SENDTO ERROR: ");

Thanks in advance

Hannes Persson
Master student CS
Blekinge Institute of Technology
mda00hpe at

More information about the freebsd-net mailing list