Problem with macro IN6_ARE_ADDR_EQUAL

KONSTANTINOS BOUKIS (konstantinos.boukis@kcl.ac.uk)
Sat, 13 Apr 2002 18:30:40 +0100 (BST)


I found out that the definition of the macro IN6_ARE_ADDR_EQUAL
in the file netinet/in.h is erroneous. In kernel 2.4.16 it is

#define IN6_ARE_ADDR_EQUAL(a,b) \
((((uint32_t *) (a))[0] == ((uint32_t *) (b))[0]) && \
(((uint32_t *) (a))[1] == ((uint32_t *) (b))[2]) && \
(((uint32_t *) (a))[2] == ((uint32_t *) (b))[1]) && \
(((uint32_t *) (a))[3] == ((uint32_t *) (b))[3]))

This macro checks the a[1] with the b[2] instead of b[1] and also
the a[2] with the b[1] instead of b[2], as a result it returns false
for equal ipv6 addresses.
costas

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/