aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid Hauweele <david@hauweele.net>2013-08-16 15:59:55 -0400
committerDavid S. Miller <davem@davemloft.net>2013-08-20 16:23:11 -0400
commit31afe1f73e46221650acfcb411e6949f4a8f7571 (patch)
treee07e41026f3919a77bb3662cc5a88ffabf110525 /net
parent84ce1ddfefc3d5a8af5ede6fe16546c143117616 (diff)
6lowpan: Fix fragmentation with link-local compressed addresses
When a new 6lowpan fragment is received, a skbuff is allocated for the reassembled packet. However when a 6lowpan packet compresses link-local addresses based on link-layer addresses, the processing function relies on the skb mac control block to find the related link-layer address. This patch copies the control block from the first fragment into the newly allocated skb to keep a trace of the link-layer addresses in case of a link-local compressed address. Edit: small changes on comment issue Signed-off-by: David Hauweele <david@hauweele.net> Signed-off-by: Alexander Aring <alex.aring@gmail.com> Reviewed-by: Werner Almesberger <werner@almesberger.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ieee802154/6lowpan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 92429db0b237..632b3fdf46a4 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -698,6 +698,12 @@ lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
698 skb_reserve(frame->skb, sizeof(struct ipv6hdr)); 698 skb_reserve(frame->skb, sizeof(struct ipv6hdr));
699 skb_put(frame->skb, frame->length); 699 skb_put(frame->skb, frame->length);
700 700
701 /* copy the first control block to keep a
702 * trace of the link-layer addresses in case
703 * of a link-local compressed address
704 */
705 memcpy(frame->skb->cb, skb->cb, sizeof(skb->cb));
706
701 init_timer(&frame->timer); 707 init_timer(&frame->timer);
702 /* time out is the same as for ipv6 - 60 sec */ 708 /* time out is the same as for ipv6 - 60 sec */
703 frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT; 709 frame->timer.expires = jiffies + LOWPAN_FRAG_TIMEOUT;