Skip to content

Commit

Permalink
Merge branch '6lowpan'
Browse files Browse the repository at this point in the history
Alexander Aring says:

====================
6lowpan: trivial changes

This patch series includes some trivial changes to prepare the 6lowpan stack
for upcomming patch-series which mainly fix fragmentation according to rfc4944
and udp handling(which is currently broken).

Changes since v3:
  - really fix intendation in patch 3/5

Changes since v2:
  - change intendation in patch 3/5
  - fix typo in 5/5 unecessary -> unnecessary
  - add missing 6lowpan tag in cover-letter
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed Oct 28, 2013
2 parents 747edc0 + 8ef007f commit d5d45d4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions net/ieee802154/6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
default:
pr_debug("ERROR: unknown UDP format\n");
goto err;
break;
}

pr_debug("uncompressed UDP ports: src = %d, dst = %d\n",
Expand Down Expand Up @@ -785,7 +784,6 @@ lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
goto skb_err;

frame->skb->priority = skb->priority;
frame->skb->dev = skb->dev;

/* reserve headroom for uncompressed ipv6 header */
skb_reserve(frame->skb, sizeof(struct ipv6hdr));
Expand Down Expand Up @@ -1120,19 +1118,19 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
int mlen, int plen, int offset, int type)
{
struct sk_buff *frag;
int hlen, ret;
int hlen;

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

lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);

frag = dev_alloc_skb(hlen + mlen + plen + IEEE802154_MFR_SIZE);
frag = netdev_alloc_skb(skb->dev,
hlen + mlen + plen + IEEE802154_MFR_SIZE);
if (!frag)
return -ENOMEM;

frag->priority = skb->priority;
frag->dev = skb->dev;

/* copy header, MFR and payload */
memcpy(skb_put(frag, mlen), skb->data, mlen);
Expand All @@ -1145,9 +1143,7 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
frag->len);

ret = dev_queue_xmit(frag);

return ret;
return dev_queue_xmit(frag);
}

static int
Expand Down Expand Up @@ -1181,7 +1177,7 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
head[0] &= ~LOWPAN_DISPATCH_FRAG1;
head[0] |= LOWPAN_DISPATCH_FRAGN;

while ((payload_length - offset > 0) && (err >= 0)) {
while (payload_length - offset > 0) {
int len = LOWPAN_FRAG_SIZE;

head[4] = offset / 8;
Expand Down

0 comments on commit d5d45d4

Please sign in to comment.