Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize packet size #7

Open
ariary opened this issue Dec 8, 2021 · 2 comments
Open

Optimize packet size #7

ariary opened this issue Dec 8, 2021 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@ariary
Copy link
Owner

ariary commented Dec 8, 2021

It seems that the getPacket does not take into account ICMP packet header:
cf

func getPacket(c *icmp.PacketConn, data []string, indexes map[int]int) {

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 ariary added bug Something isn't working enhancement New feature or request labels Dec 8, 2021
@ariary
Copy link
Owner Author

ariary commented Dec 8, 2021

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

@ariary ariary closed this as completed Dec 8, 2021
@ariary ariary reopened this Dec 8, 2021
@ariary
Copy link
Owner Author

ariary commented Dec 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant