Ard Biesheuvel wrote:

[My apologies if you think I'm taking this too far]


What about nuking the ipbox altogether and doing

sin->sin_addr.s_addr = b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3];
sin->sin_port = (unsigned short)(b[4] << 8 | b[5]);

(and using int[] instead of long int[] for b, so it will not generate any warnings unless sizeof(int) > 4)


Last time :-)


sin->sin_addr.s_addr = htonl(b[0] << 24 | b[1] << 16 | b[2] << 8 | b[3]);

sin->sin_port = htons((unsigned short)(b[4] << 8 | b[5]));

No ipbox, no byte order issues ...

--
Ard

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to