From: Alexander Aring <alex.aring@gmail.com>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, Lukasz Duda <lukasz.duda@nordicsemi.no>,
Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>,
Alexander Aring <alex.aring@gmail.com>
Subject: [PATCH bluetooth-next 1/8] 6lowpan: Fix extraction of flow label field
Date: Mon, 10 Aug 2015 21:15:52 +0200 [thread overview]
Message-ID: <1439234159-11630-2-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1439234159-11630-1-git-send-email-alex.aring@gmail.com>
From: Lukasz Duda <lukasz.duda@nordicsemi.no>
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>
---
net/6lowpan/iphc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
index 9055d7b..74e56d7 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;
--
2.5.0
next prev parent reply other threads:[~2015-08-10 17:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-10 19:15 [PATCH bluetooth-next 0/8] ieee802154: pending patches Alexander Aring
2015-08-10 19:15 ` Alexander Aring [this message]
2015-08-10 19:15 ` [PATCH bluetooth-next 2/8] ieee802154: 6lowpan: remove multiple lowpan per wpan support Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 3/8] mac802154: fix wpan mac setting while lowpan is there Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 4/8] mac802154: cfg: remove test and set checks Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 5/8] mac802154: change frame_retries behaviour Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 6/8] at86rf230: use STATE_TX_ARET mode only Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 7/8] ieee802154: add ack request default handling Alexander Aring
2015-08-10 19:15 ` [PATCH bluetooth-next 8/8] ieee802154: 6lowpan: fix error frag handling Alexander Aring
2015-08-10 19:30 ` [PATCH bluetooth-next 0/8] ieee802154: pending patches Marcel Holtmann
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=1439234159-11630-2-git-send-email-alex.aring@gmail.com \
--to=alex.aring@gmail.com \
--cc=glenn.ruben.bakke@nordicsemi.no \
--cc=kernel@pengutronix.de \
--cc=linux-wpan@vger.kernel.org \
--cc=lukasz.duda@nordicsemi.no \
/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.