diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-06 05:00:50 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-25 01:56:22 -0400 |
commit | cd97a713acbc1b63feb67ba137c3b827fa4f2308 (patch) | |
tree | c429ee51f6d108bf5544a6ceb9a1fc8c79ec5f3e /net/ieee802154 | |
parent | 39f6eb19cf85b08b8a926294750f5e79c50a6a7b (diff) |
ieee802154: 6lowpan: fix byteorder for frag tag
This patch fix byteorder issues with fragment tag of generation 802.15.4
6LoWPAN fragment header.
net/ieee802154/6lowpan_rtnl.c:278:54: warning restricted __be16 degrades to integer
net/ieee802154/6lowpan_rtnl.c:278:18: warning: incorrect type in assignment (different base types)
net/ieee802154/6lowpan_rtnl.c:278:18: expected restricted __be16 [usertype] frag_tag
net/ieee802154/6lowpan_rtnl.c:278:18: got unsigned short
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')
-rw-r--r-- | net/ieee802154/6lowpan_rtnl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index 56252ee157c9..2d547ea190e8 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c | |||
@@ -63,7 +63,7 @@ static LIST_HEAD(lowpan_devices); | |||
63 | struct lowpan_dev_info { | 63 | struct lowpan_dev_info { |
64 | struct net_device *real_dev; /* real WPAN device ptr */ | 64 | struct net_device *real_dev; /* real WPAN device ptr */ |
65 | struct mutex dev_list_mtx; /* mutex for list ops */ | 65 | struct mutex dev_list_mtx; /* mutex for list ops */ |
66 | __be16 fragment_tag; | 66 | u16 fragment_tag; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct lowpan_dev_record { | 69 | struct lowpan_dev_record { |
@@ -275,7 +275,8 @@ lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *dev, | |||
275 | 275 | ||
276 | dgram_size = lowpan_uncompress_size(skb, &dgram_offset) - | 276 | dgram_size = lowpan_uncompress_size(skb, &dgram_offset) - |
277 | skb->mac_len; | 277 | skb->mac_len; |
278 | frag_tag = lowpan_dev_info(dev)->fragment_tag++; | 278 | frag_tag = htons(lowpan_dev_info(dev)->fragment_tag); |
279 | lowpan_dev_info(dev)->fragment_tag++; | ||
279 | 280 | ||
280 | frag_hdr[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x07); | 281 | frag_hdr[0] = LOWPAN_DISPATCH_FRAG1 | ((dgram_size >> 8) & 0x07); |
281 | frag_hdr[1] = dgram_size & 0xff; | 282 | frag_hdr[1] = dgram_size & 0xff; |
@@ -294,7 +295,7 @@ lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *dev, | |||
294 | frag_len + skb_network_header_len(skb)); | 295 | frag_len + skb_network_header_len(skb)); |
295 | if (rc) { | 296 | if (rc) { |
296 | pr_debug("%s unable to send FRAG1 packet (tag: %d)", | 297 | pr_debug("%s unable to send FRAG1 packet (tag: %d)", |
297 | __func__, frag_tag); | 298 | __func__, ntohs(frag_tag)); |
298 | goto err; | 299 | goto err; |
299 | } | 300 | } |
300 | 301 | ||
@@ -315,7 +316,7 @@ lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *dev, | |||
315 | frag_len); | 316 | frag_len); |
316 | if (rc) { | 317 | if (rc) { |
317 | pr_debug("%s unable to send a FRAGN packet. (tag: %d, offset: %d)\n", | 318 | pr_debug("%s unable to send a FRAGN packet. (tag: %d, offset: %d)\n", |
318 | __func__, frag_tag, skb_offset); | 319 | __func__, ntohs(frag_tag), skb_offset); |
319 | goto err; | 320 | goto err; |
320 | } | 321 | } |
321 | } while (skb_unprocessed > frag_cap); | 322 | } while (skb_unprocessed > frag_cap); |