diff options
author | Lukasz Duda <lukasz.duda@nordicsemi.no> | 2015-08-10 21:15:52 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2015-08-10 20:43:05 +0200 |
commit | 77e867b5f133f6bb3debcfcc75ce4536d644e62e (patch) | |
tree | 8c9afab0a53f6f7ff0c5dd0aa3bfe874789069d7 /net/6lowpan | |
parent | Bluetooth: btmrvl: release sdio bus after firmware is up (diff) | |
download | linux-77e867b5f133f6bb3debcfcc75ce4536d644e62e.tar.xz linux-77e867b5f133f6bb3debcfcc75ce4536d644e62e.zip |
6lowpan: Fix extraction of flow label field
The lowpan_fetch_skb function is used to fetch the first byte,
which also increments the data pointer in skb structure,
making subsequent array lookup of byte 0 actually being byte 1.
To decompress the first byte of the Flow Label when the TF flag is
set to 0x01, the second half of the first byte is needed.
The patch fixes the extraction of the Flow Label field.
Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no>
Signed-off-by: Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r-- | net/6lowpan/iphc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c index 9055d7b9d112..74e56d7449c8 100644 --- a/net/6lowpan/iphc.c +++ b/net/6lowpan/iphc.c @@ -284,7 +284,7 @@ lowpan_header_decompress(struct sk_buff *skb, struct net_device *dev, if (lowpan_fetch_skb(skb, &tmp, sizeof(tmp))) return -EINVAL; - hdr.flow_lbl[0] = (skb->data[0] & 0x0F) | ((tmp >> 2) & 0x30); + hdr.flow_lbl[0] = (tmp & 0x0F) | ((tmp >> 2) & 0x30); memcpy(&hdr.flow_lbl[1], &skb->data[0], 2); skb_pull(skb, 2); break; |