All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Ceuleers <jan.ceuleers@computer.org>
To: Tony Cheneau <tony.cheneau@amnesiak.org>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-zigbee-devel@lists.sourceforge.net,
	Alan Ott <alan@signal11.us>,
	Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
Subject: Re: [PATCH net-next 06/15] 6lowpan: fix first fragment (FRAG1) handling
Date: Tue, 23 Oct 2012 09:19:38 +0200	[thread overview]
Message-ID: <5086450A.9050506@computer.org> (raw)
In-Reply-To: <1350965397-12384-7-git-send-email-tony.cheneau@amnesiak.org>

On 10/23/2012 06:09 AM, Tony Cheneau wrote:
> The first fragment, FRAG1, must contain some payload according to the
> specs. However, as it is currently written, the first fragment will
> remain empty and only contain the 6lowpan headers.
> 
> This patch also extract the transport layer information from the first
> fragment. This information is later on use when uncompressing UDP
> header.
> 
> Signed-off-by: Tony Cheneau <tony.cheneau@amnesiak.org>
> ---
>  net/ieee802154/6lowpan.c |   54 +++++++++++++++++++++++++++++++++++----------
>  1 files changed, 42 insertions(+), 12 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 8a2ee95..38cecaf 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -654,7 +654,7 @@ static void lowpan_fragment_timer_expired(unsigned long entry_addr)
>  }
>  
>  static struct lowpan_fragment *
> -lowpan_alloc_new_frame(struct sk_buff *skb, u8 len, u16 tag)
> +lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
>  {
>  	struct lowpan_fragment *frame;
>  
> @@ -735,6 +735,18 @@ lowpan_process_data(struct sk_buff *skb)
>  		/* adds the 3 MSB to the 8 LSB to retrieve the 11 bits length */
>  		len = ((iphc0 & 7) << 8) | slen;
>  
> +		if ((iphc0 & LOWPAN_DISPATCH_MASK) == LOWPAN_DISPATCH_FRAG1) {
> +			pr_debug("%s received a FRAG1 packet (tag: %d, "
> +				 "size of the entire IP packet: %d)"
> +				 , __func__, tag, len);

There are several schools of thought on the relative importance of
observing the 80-character line limit versus breaking up string
constants (in an attempt to maintain grepability). I think the above is
fine but others (whose opinion matters more than mine) may or may not
agree. Whatever you decide here, please apply consistently throughout.

However, the comma ahead of the __func__ should be at the end of the
previous line.

(...)

> -	/* if payload length is zero, therefore it's a first fragment */
> -	hlen = (plen == 0 ? LOWPAN_FRAG1_HEAD_SIZE :  LOWPAN_FRAGN_HEAD_SIZE);
> +	hlen = (type == LOWPAN_DISPATCH_FRAG1 ? LOWPAN_FRAG1_HEAD_SIZE :
> +			LOWPAN_FRAGN_HEAD_SIZE);

The second line of this statement should be aligned as follows:

+	hlen = (type == LOWPAN_DISPATCH_FRAG1 ? LOWPAN_FRAG1_HEAD_SIZE :
+		LOWPAN_FRAGN_HEAD_SIZE);

So the L for LOWPAN_FRAGN_HEAD_SIZE should be underneath the t for type.

  reply	other threads:[~2012-10-23  7:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  4:09 [PATCH net-next 00/15] 6lowpan: Some more bug fixes Tony Cheneau
     [not found] ` <1350965397-12384-1-git-send-email-tony.cheneau-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
2012-10-23  4:09   ` [PATCH net-next 01/15] 6lowpan: lowpan_is_iid_16_bit_compressable() does not detect compressable address correctly Tony Cheneau
2012-10-23  6:49     ` David Miller
2012-10-23 14:57       ` Tony Cheneau
2012-10-23  7:04     ` Jan Ceuleers
2012-10-23  4:09   ` [PATCH net-next 02/15] 6lowpan: next header is not properly set upon decompression of a UDP header Tony Cheneau
2012-10-23  7:05     ` Jan Ceuleers
2012-10-23  4:09   ` [PATCH net-next 03/15] 6lowpan: always enable link-layer acknowledgments Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 04/15] mac802154: turn on ACK when enabled by the upper layers Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 05/15] 6lowpan: use short IEEE 802.15.4 addresses for broadcast destination Tony Cheneau
2012-10-23  7:08     ` Jan Ceuleers
2012-10-23  4:09   ` [PATCH net-next 06/15] 6lowpan: fix first fragment (FRAG1) handling Tony Cheneau
2012-10-23  7:19     ` Jan Ceuleers [this message]
2012-10-23 14:50       ` Tony Cheneau
2012-10-23 15:03         ` Eric Dumazet
2012-10-23  4:09   ` [PATCH net-next 07/15] 6lowpan: store fragment tag values per device instead of net stack wide Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 08/15] 6lowpan: obtain IEEE802.15.4 sequence number from the MAC layer Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 09/15] 6lowpan: add a new parameter in sysfs to turn on/off ACK request at " Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 10/15] 6lowpan: use the PANID provided by the device instead of a static value Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 11/15] 6lowpan: modify udp compression/uncompression to match the standard Tony Cheneau
2012-10-23  7:22     ` Jan Ceuleers
2012-10-23  4:09   ` [PATCH net-next 12/15] 6lowpan: make memory allocation atomic during 6lowpan header creation Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 13/15] mac802154: make mem alloc ATOMIC to prevent "scheduling while atomic" crashes Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 14/15] mac802154: remove unnecessary spinlocks Tony Cheneau
2012-10-23  4:09   ` [PATCH net-next 15/15] mac802154: re-introduce MAC primitives required to send/receive packets Tony Cheneau
2012-10-25  4:52 ` [PATCH net-next 00/15] 6lowpan: Some more bug fixes Alexander Smirnov
2012-10-25 14:49   ` Tony Cheneau
     [not found]     ` <383f66ae460548de6f930b0f1c244e5a-jNfjcPZKvDhg9hUCZPvPmw@public.gmane.org>
2012-10-25 15:10       ` Alan Ott

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=5086450A.9050506@computer.org \
    --to=jan.ceuleers@computer.org \
    --cc=alan@signal11.us \
    --cc=alex.bluesman.smirnov@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-zigbee-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=tony.cheneau@amnesiak.org \
    /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.