In these days, when network adapters have many offloading facilities,
we can receive packet with length bigger than MTU. So pass the MSG_TRUNC
flag to the recvfrom() function (it gives us the on-wire length even if
the buffer is not big enough).
First 256B of the packet is enough to have all the needed
information about packet (we need packet headers only and
not its data).
Vitezslav Samel (2):
packet.c: getpacket(): get total on-wire length of packet
packet.c: getpacket(): capture first 256B of the packet only
src/packet.c | 2 +-
src/packet.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
1.7.8.4