-
Notifications
You must be signed in to change notification settings - Fork 300
Open
Labels
Description
I was compiling and using the same OpENer server on both little-endian and big-endian machines, and found out that response packet for Forward Open Request differs.
Wireshark logs:
ubuntu 24:
I started digging around and came across this function:
The problem is AddIntToMessage(htons(AF_INET), outgoing_message) which writes value (not internal memory representation) byte by byte in little-endian order.
AddIntToMessage(htons(AF_INET), outgoing_message);
But the value htons(AF_INET) for big-endian stays the same and not gets converted.
It should be
AddSintToMessage(AF_INET >> 8, outgoing_message);
AddSintToMessage(AF_INET, outgoing_message);
which fixes the problem and it works.
