ieee802154: || vs && in ieee802154_is_valid_extended_addr()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 4 Nov 2014 08:55:09 +0000 (11:55 +0300)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 4 Nov 2014 16:44:48 +0000 (17:44 +0100)
The ieee802154_is_valid_extended_addr() always returns true because
there is a typo.  The || should be &&.  Neither 0x0000000000000000ULL
nor 0xffffffffffffffffULL are valid addresses.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/linux/ieee802154.h

index 5d9e7459d94b417b2929207fc8699612e01a1ce6..4c032863cd714bf4498118d42203c27e863c8b34 100644 (file)
@@ -209,7 +209,7 @@ static inline bool ieee802154_is_valid_extended_addr(const __le64 addr)
         * This is currently a workaround because neighbor discovery can't
         * deal with short addresses types right now.
         */
-       return ((addr != cpu_to_le64(0x0000000000000000ULL)) ||
+       return ((addr != cpu_to_le64(0x0000000000000000ULL)) &&
                (addr != cpu_to_le64(0xffffffffffffffffULL)));
 }