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

DEV9: Various Socket Fixes #12059

Merged
merged 5 commits into from
Dec 5, 2024
Merged

DEV9: Various Socket Fixes #12059

merged 5 commits into from
Dec 5, 2024

Conversation

TheLastRar
Copy link
Contributor

Description of Changes

Skip over invalid gateways for DHCP Auto Gateways on Windows
Correct SetDscpValue() function definition and remove unused duplicate definitions for Read/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

@github-actions github-actions bot added the DEV9 label Dec 3, 2024
@F0bes F0bes merged commit f91f39a into PCSX2:master Dec 5, 2024
12 checks passed
@TheLastRar TheLastRar deleted the DEV9-Fixes branch December 5, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants