[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(usagi-users 00712) PATCH: incorrect test for all-nodes multicast address



Function ipv6_addr_is_ll_all_nodes() in addrconf.h appears to have a bug.
Instead of a bit-wise AND
of words 1 & 2, I believe it should be checking for 0's. With this,
ff02:0:1:0:2::1 would match incorrectly, for example.
diffs for fix below.

                                              +-DLS

--- addrconf.h Fri Aug 24 16:12:04 2001
+++ addrconf.h.NEW  Fri Aug 24 16:14:11 2001
@@ -290,7 +290,7 @@
 static inline int ipv6_addr_is_ll_all_nodes(struct in6_addr *addr)
 {
     return (addr->s6_addr32[0] == __constant_htonl(0xff020000) &&
-         (addr->s6_addr32[1] & addr->s6_addr32[2]) == 0 &&
+         addr->s6_addr32[1] == 0 && addr->s6_addr32[2] == 0
          addr->s6_addr32[3] == __constant_htonl(0x00000001));
 }