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

recived byte numbers from RECVFROM()



hi:
Now I am trying to get packets using a raw_sock:

  ph_fd=socket(PF_PACKET,SOCK_RAW,htons(ETH_P_ALL));
  n=recvfrom(ph_fd,buf,bufsize*sizeof(buf),0,NULL,NULL);
  (ip *)ip_hd=(ip*)(buf+14);
   int totalLen=ip_hd->ip_len;

   the problem is :
   ip_len!=n-14.


I checked the buffer,find the N may be the correct bytes number received. is it right?
   but  why they are different?Is there any epcial meaning of ip_len??
Can anyone help me?
   thank you.


--
To UNSUBSCRIBE, email to debian-glibc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: