diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-06 05:00:51 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-25 01:56:22 -0400 |
commit | f870b8c6314c85712ff1e82765a902d895b73f21 (patch) | |
tree | c797d7c6bf992b63433a43c68b159a60eb41379d /net/ieee802154/reassembly.c | |
parent | cd97a713acbc1b63feb67ba137c3b827fa4f2308 (diff) |
ieee802154: reassembly: fix tag byteorder
This patch fix byte order handling in reassembly code of 802.15.4
6LoWPAN fragmentation handling.
net/ieee802154/reassembly.c:58:43: warning: restricted __be16 degrades to integer
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154/reassembly.c')
-rw-r--r-- | net/ieee802154/reassembly.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/ieee802154/reassembly.c b/net/ieee802154/reassembly.c index 7cfcd6885225..9d980ed3ffe2 100644 --- a/net/ieee802154/reassembly.c +++ b/net/ieee802154/reassembly.c | |||
@@ -33,7 +33,7 @@ | |||
33 | static const char lowpan_frags_cache_name[] = "lowpan-frags"; | 33 | static const char lowpan_frags_cache_name[] = "lowpan-frags"; |
34 | 34 | ||
35 | struct lowpan_frag_info { | 35 | struct lowpan_frag_info { |
36 | __be16 d_tag; | 36 | u16 d_tag; |
37 | u16 d_size; | 37 | u16 d_size; |
38 | u8 d_offset; | 38 | u8 d_offset; |
39 | }; | 39 | }; |
@@ -48,7 +48,7 @@ static struct inet_frags lowpan_frags; | |||
48 | static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, | 48 | static int lowpan_frag_reasm(struct lowpan_frag_queue *fq, |
49 | struct sk_buff *prev, struct net_device *dev); | 49 | struct sk_buff *prev, struct net_device *dev); |
50 | 50 | ||
51 | static unsigned int lowpan_hash_frag(__be16 tag, u16 d_size, | 51 | static unsigned int lowpan_hash_frag(u16 tag, u16 d_size, |
52 | const struct ieee802154_addr *saddr, | 52 | const struct ieee802154_addr *saddr, |
53 | const struct ieee802154_addr *daddr) | 53 | const struct ieee802154_addr *daddr) |
54 | { | 54 | { |
@@ -330,11 +330,13 @@ static int lowpan_get_frag_info(struct sk_buff *skb, const u8 frag_type, | |||
330 | { | 330 | { |
331 | bool fail; | 331 | bool fail; |
332 | u8 pattern = 0, low = 0; | 332 | u8 pattern = 0, low = 0; |
333 | __be16 d_tag = 0; | ||
333 | 334 | ||
334 | fail = lowpan_fetch_skb(skb, &pattern, 1); | 335 | fail = lowpan_fetch_skb(skb, &pattern, 1); |
335 | fail |= lowpan_fetch_skb(skb, &low, 1); | 336 | fail |= lowpan_fetch_skb(skb, &low, 1); |
336 | frag_info->d_size = (pattern & 7) << 8 | low; | 337 | frag_info->d_size = (pattern & 7) << 8 | low; |
337 | fail |= lowpan_fetch_skb(skb, &frag_info->d_tag, 2); | 338 | fail |= lowpan_fetch_skb(skb, &d_tag, 2); |
339 | frag_info->d_tag = ntohs(d_tag); | ||
338 | 340 | ||
339 | if (frag_type == LOWPAN_DISPATCH_FRAGN) { | 341 | if (frag_type == LOWPAN_DISPATCH_FRAGN) { |
340 | fail |= lowpan_fetch_skb(skb, &frag_info->d_offset, 1); | 342 | fail |= lowpan_fetch_skb(skb, &frag_info->d_offset, 1); |