[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140514155503.GA14689@omega>
Date: Wed, 14 May 2014 17:56:57 +0200
From: Alexander Aring <alex.aring@...il.com>
To: Phoebe Buckheister <phoebe.buckheister@...m.fraunhofer.de>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
linux-zigbee-devel@...ts.sourceforge.net
Subject: Re: [Linux-zigbee-devel] [PATCH net-next 4/6] 6lowpan: fix
fragmentation
Hi Phoebe,
that's a nice solution for the DSN increment on fragmentation. This
stands long time on my ToDo list and you did a very nice solution.
Thanks. :-)
On Wed, May 14, 2014 at 05:43:09PM +0200, Phoebe Buckheister wrote:
> Currently, 6lowpan creates one 802.15.4 MAC header for the original
> packet the device was given by upper layers and reuses this header for
> all fragments, if fragmentation is required. This also reuses frame
> sequence numbers, which must not happen. 6lowpan also has issues with
> fragmentation in the presence of security headers, since those may imply
> the presence of trailing fields that are not accounted for by the
> fragmentation code right now.
>
> Fix both of these issues by properly allocating fragment skbs with
> headromm and tailroom as specified by the underlying device, create one
> header for each skb instead of reusing the original header, let the
> underlying device do the rest.
>
> Signed-off-by: Phoebe Buckheister <phoebe.buckheister@...m.fraunhofer.de>
> ---
> net/ieee802154/6lowpan_rtnl.c | 198 ++++++++++++++++++++++-------------------
> 1 file changed, 104 insertions(+), 94 deletions(-)
>
> diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
> index d0191c5..1ae8a56 100644
> --- a/net/ieee802154/6lowpan_rtnl.c
> +++ b/net/ieee802154/6lowpan_rtnl.c
> @@ -220,139 +220,149 @@ static int lowpan_set_address(struct net_device *dev, void *p)
> return 0;
> }
>
> -static int
> -lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
> - int mlen, int plen, int offset, int type)
> +static struct sk_buff*
> +lowpan_alloc_frag(struct sk_buff *skb, int size,
> + const struct ieee802154_hdr *master_hdr)
> {
> + struct net_device *real_dev = lowpan_dev_info(skb->dev)->real_dev;
> struct sk_buff *frag;
> - int hlen;
> -
> - hlen = (type == LOWPAN_DISPATCH_FRAG1) ?
> - LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE;
> -
> - raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
> + int rc;
> +
> + frag = alloc_skb(real_dev->hard_header_len +
> + real_dev->needed_tailroom + size,
> + GFP_ATOMIC);
Why not keep netdev_alloc_skb for the real_dev?
But then we need to use dev_kfree_skb.
- Alex
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists