Add support for setting do-not-fragment bit (linux) #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #23
This PR only attempts to add support for this in linux. It seems it may be feasible to add support for this under windows but I do not have any way of testing this easily so for now this will be omitted. Other platforms I could not get this working as the socket options required to do this are unclear under BSD platforms (for example) but it may be possible to support this after a little more r&d.
I tested using:
Which yielded a 1500 byte IP packet (my IP MTU is 1500) per tcpdump on the wire:
Doing the same as the above but setting
pinger.Size = 1473
we get the following error from the kernel which is what we expect to see with do-not-fragment set: