Index: alias.c =================================================================== RCS file: /home/ncvs/src/lib/libalias/alias.c,v retrieving revision 1.46 diff -u -r1.46 alias.c --- alias.c 5 Jul 2004 11:10:57 -0000 1.46 +++ alias.c 5 Jul 2004 16:42:00 -0000 @@ -139,9 +139,16 @@ static __inline int twowords(void *p) { - u_short *s = p; + uint8_t *c = p; - return (s[0] + s[1]); +#if BYTE_ORDER == LITTLE_ENDIAN + uint16_t s1 = ((uint16_t)c[1] << 8) + (uint16_t)c[0]; + uint16_t s2 = ((uint16_t)c[3] << 8) + (uint16_t)c[2]; +#else + uint16_t s1 = ((uint16_t)c[0] << 8) + (uint16_t)c[1]; + uint16_t s2 = ((uint16_t)c[2] << 8) + (uint16_t)c[3]; +#endif + return (s1 + s2); } /* TCP Handling Routines