Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From a short look, I tend to agree with you.

> memcpy(packet + 1, &con->ping_request_id, sizeof(uint64_t));

Copying multi-byte values into a network packet is a typical error made by novice developers - this will bite you hard as soon as somebody compiles the code on a Big Endian machine. Even if you might get away with this on opaque elements like a ping ID, the general approach should not be followed.



endianess doesn't matter when you all you do with it is store it and check if it's equal to another.

In all cases where it does matter, the values are converted.

Tox has been confirmed working on big endian machines by many people.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: