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.
Description of Changes
Skip over invalid gateways for DHCP Auto Gateways on Windows
Correct
SetDscpValue()
function definition and remove unused duplicate definitions forRead/WriteDNSString()
Guard against out of bound reads when handling ICMP port rejected packets
Use Common functions for aligning header length
Fix possible race-condition when removing closed connections
Rationale behind Changes
A gateway of 0.0.0.0 is not usable, code to exclude this existed for other platforms.
Function definitions should not be incorrect.
When handling malformed ICMP packets, the offset to the contained IP packet was not accounted for when reading said IP packet.
Additionally, make sure we don't loop (potentially) infinitely if we get a really malformed packet.
Existing alignment for IP and TCP options was correct enough to work, but not actually correct.
If you are unlucky, a connection could close itself while the adapter was reset (potentially closing itself again),
This would result in our connection close handler trying to delete the connection twice.
Check if the connection is in our connections map, if it isn't then we are already handling it.
I opted to group these into a single PR, If it is preferred to separate then out into their own PRs, then I can do so.
Suggested Testing Steps
Test online games with Sockets