linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Stefan Schmidt <stefan@osg.samsung.com>
Cc: Lukasz Duda <lukasz.duda@nordicsemi.no>,
	jukka.rissanen@linux.intel.com, linux-bluetooth@vger.kernel.org,
	linux-wpan@vger.kernel.org,
	Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>,
	marcel@holtmann.org
Subject: Re: [PATCH] 6lowpan: Fix extraction of flow label field
Date: Fri, 31 Jul 2015 00:23:56 +0200	[thread overview]
Message-ID: <20150730222353.GB1037@omega> (raw)
In-Reply-To: <55BA8319.2000208@osg.samsung.com>

On Thu, Jul 30, 2015 at 10:03:37PM +0200, Stefan Schmidt wrote:
> Hello.
> 
> On 30/06/15 12:24, Lukasz Duda wrote:
> >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.
> >
> >Signed-off-by: Lukasz Duda <lukasz.duda@nordicsemi.no>
> >Signed-off-by: Glenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
> >---
> >  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;
> 
> Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
> 
> Alex, I agree that this area needs some improvements. I would still like to
> see this simple and obvious bug fix to go in now even if it gets changed
> with a refactor later on. Better have this bug fixed now. :) You acked it

I need to admit, I refactor this function multiple times and never had
time (or maybe I simple not did it, don't know why) to sending patches
for it. There is too also much things which can be optimized in the whole
iphc code. :-/

Also I remember 2-3 workarounds which we have inside IEEE 802.15.4
6LoWPAN, also having inside my queue 802.15.4 security layer and such
things. At the moment not a good idea to deal with all at the same time.

> already so I think it is fine to go in? Marcel did not apply it yet.
> 

Yes, I forget that patch and Marcel asked me today what's inside the
queue. So the pull request for net-next is already out, but I think we
can live to having this patch in the next one.

Marcel can you please apply this patch?

Jukka you are also fine with this patch? Please send your Acked-by then.

Thanks.

- Alex

      reply	other threads:[~2015-07-30 22:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 10:24 [PATCH] 6lowpan: Fix extraction of flow label field Lukasz Duda
2015-06-30 21:22 ` Alexander Aring
2015-07-31  6:31   ` Jukka Rissanen
2015-07-01 16:22 ` Alexander Aring
2015-07-30 20:03 ` Stefan Schmidt
2015-07-30 22:23   ` Alexander Aring [this message]

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=20150730222353.GB1037@omega \
    --to=alex.aring@gmail.com \
    --cc=glenn.ruben.bakke@nordicsemi.no \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=lukasz.duda@nordicsemi.no \
    --cc=marcel@holtmann.org \
    --cc=stefan@osg.samsung.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).