Note sure where to put this information. I don't want to fork just to edit the .md so I'm gonna make it an ticket.
In the "Hints" section for HTONS, it says that newer versions of windows set the 16th bit. But that's not quite right. For different numbers it sets more bits.
On Windows Server 2022 and Windows 11 htons() is returning a result with more than 16-bits. (To fill in the extra bits, it's cycling through the significant bits of the number again. So it's simply nonsense.)
The fix is to ignore everything after the 15th bit. e.g.
Note sure where to put this information. I don't want to fork just to edit the .md so I'm gonna make it an ticket.
In the "Hints" section for HTONS, it says that newer versions of windows set the 16th bit. But that's not quite right. For different numbers it sets more bits.
587 becomes 150274 instead of 19202
2525 becomes 646409 instead of 56585
20000 becomes 5120078 instead of 8270
On Windows Server 2022 and Windows 11 htons() is returning a result with more than 16-bits. (To fill in the extra bits, it's cycling through the significant bits of the number again. So it's simply nonsense.)
The fix is to ignore everything after the 15th bit. e.g.