Merge 5b597fab4391484ae1d18f8df8b9b159a30a75b3 into cc8ae725c801419d9926951951816e9ac6ca67d0

This commit is contained in:
RoboSchmied 2024-03-28 02:03:09 +00:00 committed by GitHub
commit d815788b12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,7 +133,7 @@ func (s *searcher) Search(b []byte, ip netip.Addr, port uint16) (uint32, error)
}
// according to MSDN, only the lower 16 bits of dwLocalPort are used and the port number is in network endian.
// this field can be illustrated as follows depends on different machine endianess:
// this field can be illustrated as follows depends on different machine endianness:
// little endian: [ MSB LSB 0 0 ] interpret as native uint32 is ((LSB<<8)|MSB)
// big endian: [ 0 0 MSB LSB ] interpret as native uint32 is ((MSB<<8)|LSB)
// so we need an syscall.Ntohs on the lower 16 bits after read the port as native uint32