QueenSono icon indicating copy to clipboard operation
QueenSono copied to clipboard

Optimize packet size

Open ariary opened this issue 3 years ago • 2 comments

It seems that the getPacket does not take into account ICMP packet header: cf https://github.com/ariary/QueenSono/blob/59dd5da577325ac5f45f0012112886b893c4d88c/pkg/icmp/receive.go#L138

Try replace it by 65535, to get the whole size of th ip packet

(https://stackoverflow.com/questions/9449837/maximum-legal-size-of-icmp-echo-packet)

ariary avatar Dec 08 '21 10:12 ariary

Change default value to 65505, don't know why work a bit but sendto: message too long after a bit

ariary avatar Dec 08 '21 11:12 ariary

It seems that the ICMP headers don"t have fixed length and could be > 28 bytes. idem for data. Don't know if it is depending on the OS or the net/icmp library

=> Change default value of data packet size to 65488 (Data take 2bytes more afterwards, and sometimes 3)

If you want to avoid any crash use -s 65450

ariary avatar Dec 10 '21 08:12 ariary