|
Jayanth Gurijala
12/06/2008 2:12 PM
post18076
|
Hi,
I am trying to capture ICMP ping packets.
Using socket(AF_INET, SOCK_DGRAM, 1), the call the recvfrom blocks even when i ping the machine running the
application(x86 using io-pkt-hc).
here is the code after socket creation.
memset(&daddr, 0, sizeof(daddr));
addrlen = sizeof(daddr);
printf("Waiting...\n");
/*THIS CALL JUST HANGS*/
if ((recvfrom(s, buf, 100, 0, (struct sockaddr *)&daddr, &addrlen))==-1)
{
printf("Receive error: %s\n", strerror(errno));
continue;
}
printf("Packet received: ");
Can anyone help me out?
Thanks,
Jayanth
|
|
|
|
|