All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, jukka.rissanen@linux.intel.com,
	hannes@stressinduktion.org, stefan@osg.samsung.com,
	mcr@sandelman.ca, werner@almesberger.net,
	Alexander Aring <aar@pengutronix.de>
Subject: [RFCv2 bluetooth-next 04/21] ieee802154: 6lowpan: fix short addr hash
Date: Thu,  7 Apr 2016 20:54:05 +0200	[thread overview]
Message-ID: <1460055262-4330-5-git-send-email-aar@pengutronix.de> (raw)
In-Reply-To: <1460055262-4330-1-git-send-email-aar@pengutronix.de>

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>
---
 net/ieee802154/6lowpan/6lowpan_i.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan/6lowpan_i.h b/net/ieee802154/6lowpan/6lowpan_i.h
index b4e17a7..b4092a9 100644
--- a/net/ieee802154/6lowpan/6lowpan_i.h
+++ b/net/ieee802154/6lowpan/6lowpan_i.h
@@ -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;
 	}
-- 
2.8.0


  parent reply	other threads:[~2016-04-07 18:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 18:54 [RFCv2 bluetooth-next 00/21] 6lowpan: l2 neighbour data and short address Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 01/21] ieee802154: cleanups for ieee802154.h Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 02/21] ieee802154: add short address helpers Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 03/21] nl802154: avoid address change while running lowpan Alexander Aring
2016-04-07 18:54 ` Alexander Aring [this message]
2016-04-07 18:54 ` [RFCv2 bluetooth-next 05/21] 6lowpan: change naming for lowpan private data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 06/21] 6lowpan: move lowpan_802154_dev to 6lowpan Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 07/21] 6lowpan: iphc: rename add lowpan prefix Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 08/21] 6lowpan: iphc: remove unnecessary zero data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 09/21] 6lowpan: move eui64 uncompress function Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 10/21] 6lowpan: add lowpan_is_ll function Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 11/21] 6lowpan: move mac802154 header Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 12/21] 6lowpan: add private neighbour data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 13/21] 6lowpan: add 802.15.4 short addr slaac Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 14/21] 6lowpan: remove ipv6 module request Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 15/21] ndisc: add addr_len parameter to ndisc_opt_addr_space Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 16/21] ndisc: add addr_len parameter to ndisc_opt_addr_data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 17/21] ndisc: add addr_len parameter to ndisc_fill_addr_option Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 18/21] ipv6: introduce neighbour discovery ops Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 19/21] ipv6: export ndisc functions Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 20/21] 6lowpan: introduce 6lowpan-nd Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 21/21] 6lowpan: add support for 802.15.4 short addr handling Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460055262-4330-5-git-send-email-aar@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=hannes@stressinduktion.org \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    --cc=mcr@sandelman.ca \
    --cc=stefan@osg.samsung.com \
    --cc=werner@almesberger.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.