PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
Other
10.56k stars 1.53k forks source link

DEV9: More strictly enforce MTU in pcap #11247

Closed TheLastRar closed 3 days ago

TheLastRar commented 1 month ago

Description of Changes

More strictly enforce MTU of packets received using pcap

Rationale behind Changes

The previous limit was not strict enough, allowing 'small' jumbo frames to be received. This was causing TLB misses and other issues in some homebrew software, due to what appeared to be a buffer overrun.

Suggested Testing Steps

Test pcap backend on network games and homebrew (that receive large packets). Testing should be performed in a network that supports an MTU > 1500 Testing in networks that have an MTU == 1500 would be useful to ensure we aren't too strict.

~~I currently assume that libpcap dosn't capture the etherframe FCS This might not be the case on FreeBSD or MacOSX, as libpcap, so specific testing there would needed.~~

TheLastRar commented 1 month ago

Added code to account for the Ethernet frame sequence check. Some adapters (can be configured to) allow this field to be captured, The PS2 SDK, appears to expect this field to be trimmed (or else it would overflow their buffer), so we have to do the same.