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 [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to