Claudio Lavecchia wrote:

3. How do you calculate size_ip?

int size_ip = sizeof(struct sniff_ip);

Do any of the packets have IP options? If so, then that's *not* the size of the IP header.


You should get the IP header length from the header length/version field from the IP header (and should check that this field has a value >= 5, meaning 20 bytes, as that's the minimum IP header length).
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.

Reply via email to