Hi Swati,
I noticed that you have filled the packet with zeros. You need to fill in at
least the icmpv6 header in the packet. I would do it this way
struct icmp6_hdr *hdr;
char buf[WHATEVER_SIZE]; /* Your transmit buf */
hdr=(struct icmp6_hdr *)buf;
hdr->icmp6_type=ICMP6_ECHO_REQUEST; /* If this constant is not defined on your
box use 128 */
hdr->icmp6_code=0;
hdr->icmp6_cksum=0;
hdr->icmp6_seq=<some_kind_of_counter>;
pkt->icmp6_id=<your_id>;
...
Regards
Suresh
-----Original Message-----
From: AGARWAL,SWATI (HP-FtCollins,ex1) [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 11:50 AM
To: [EMAIL PROTECTED]
Subject: Trying to do a IPv6 ping on Windows
Here are the basic excerpts of my program without the error checking.
I am getting an error 10035 from the recvfrom which indicates WSAEWOULDBLOCK
which means that there is no data can be read from the m_Sockfd socket.
Does anyone know what the problem might be? I even tried doing a wait before
doing the recvfrom. Ping6 program for the IPv6 address being tested works
promptly from the command line.
Regards
Swati
PORGRAM:
int error;
WORD wVersionRequested;
WSADATA wsaData;
wVersionRequested = MAKEWORD(2,2);
WSAStartup(wVersionRequested, &wsaData);
m_Sockfd = WSASocket(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6,NULL,0,0);
int n = setsockopt(m_Sockfd, SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
memset( m_SendBuff, 0, 64);
memset( m_RecvBuff, 0, 64);
len = sendto(m_Sockfd, m_SendBuff, hdr_len, 0, m_Ai->ai_addr,
m_Ai->ai_addrlen)
memset(m_Sarecv, 0, m_Len);
int n = recvfrom(m_Sockfd, m_RecvBuff, sizeof(m_RecvBuff), 0, m_Sarecv,
&m_Len);
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page: http://playground.sun.com/ipng
FTP archive: ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------