ieee802154: 6lowpan: fix short addr hash
authorAlexander Aring <aar@pengutronix.de>
Mon, 11 Apr 2016 09:04:17 +0000 (11:04 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 13 Apr 2016 08:41:09 +0000 (10:41 +0200)
The short address is unique in combination with the panid. This patch
will add the panid for generating an ieee802154 address hash.

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <aar@pengutronix.de>
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
net/ieee802154/6lowpan/6lowpan_i.h

index b4e17a7..b4092a9 100644 (file)
@@ -41,7 +41,7 @@ static inline u32 ieee802154_addr_hash(const struct ieee802154_addr *a)
                return (((__force u64)a->extended_addr) >> 32) ^
                        (((__force u64)a->extended_addr) & 0xffffffff);
        case IEEE802154_ADDR_SHORT:
-               return (__force u32)(a->short_addr);
+               return (__force u32)(a->short_addr + (a->pan_id << 16));
        default:
                return 0;
        }