Convert port with htons() in p_getaddrinfo()#4280
Conversation
`sin_port` should be in network byte order.
|
Thanks for this fix, looks good to me! @ethomson? Just out of curiosity: on which platform did you experience problems with this? |
|
Porting libgit2 to Redox OS (https://redox-os.org/), which at the moment has a very basic Berkeley sockets implementation. So Redox's implementation could be incorrect, but the Posix standard states clearly that |
|
Agree that this should be in network byte order. @ids1024 - I'm not surprised it was broken, this was added explicitly for AmigaOS and I'm pretty sure only ever used by them until now. AmigaOS is m68k and thus big endian (or so I would suspect by the name.) |
|
Ah, AmigaOS. I thought it was probably something like that, but I wasn't sure what big endian platform the code would have been used with. |
|
So I'm merging this as we all seem to agree this is correct. Thanks for your fixup! 🎆 |
sin_portshould be in network byte order.