[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 02255) Re: Raw socket + IPv6 = sendto invalid argument



Hi again,

Thanks to everyone for your help, setting port=0 solved by problem. What
happens now is that I can't recv() from the raw socket.
I create the socket this way:

s = socket(PF_INET6, SOCK_RAW, IPPROTO_RAW);

And now the call "recv(s, buf, BUFSIZE, 0)" never returns. The client socket
is created the same way, and the data is sent with:

sendto(s, buf, BUFSIZE, 0, &dest, sizeof(dest));

where "dest" is a 'struct sockaddr_in6' for "::1" (client and server are
running on the same machine). The data is a forged IPv6 packet to ::1. Doing
a "bind()" on the server before recv'ing doesn't help either (with a
sockaddr_in6 for "::1" too).

Any help?
Thanks in advance.