Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351463
b: refs/heads/master
c: ee21c7e
h: refs/heads/master
i:
  351461: 7d96224
  351459: 115c515
  351455: e2521e0
v: v3
  • Loading branch information
Alan Ott authored and David S. Miller committed Jan 18, 2013
1 parent f815451 commit 57dc2b9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c446212c4f68e51ba03a9b172599437d6660a9d
refs/heads/master: ee21c7e0d1f6e742e9f441f580a3bac316a39a21
41 changes: 32 additions & 9 deletions trunk/net/ieee802154/6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1147,19 +1147,42 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
goto drop;

/* check that it's our buffer */
switch (skb->data[0] & 0xe0) {
case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */
case LOWPAN_DISPATCH_FRAG1: /* first fragment header */
case LOWPAN_DISPATCH_FRAGN: /* next fragments headers */
local_skb = skb_clone(skb, GFP_ATOMIC);
if (skb->data[0] == LOWPAN_DISPATCH_IPV6) {
/* Copy the packet so that the IPv6 header is
* properly aligned.
*/
local_skb = skb_copy_expand(skb, NET_SKB_PAD - 1,
skb_tailroom(skb), GFP_ATOMIC);
if (!local_skb)
goto drop;
lowpan_process_data(local_skb);

local_skb->protocol = htons(ETH_P_IPV6);
local_skb->pkt_type = PACKET_HOST;

/* Pull off the 1-byte of 6lowpan header. */
skb_pull(local_skb, 1);
skb_reset_network_header(local_skb);
skb_set_transport_header(local_skb, sizeof(struct ipv6hdr));

lowpan_give_skb_to_devices(local_skb);

kfree_skb(local_skb);
kfree_skb(skb);
break;
default:
break;
} else {
switch (skb->data[0] & 0xe0) {
case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */
case LOWPAN_DISPATCH_FRAG1: /* first fragment header */
case LOWPAN_DISPATCH_FRAGN: /* next fragments headers */
local_skb = skb_clone(skb, GFP_ATOMIC);
if (!local_skb)
goto drop;
lowpan_process_data(local_skb);

kfree_skb(skb);
break;
default:
break;
}
}

return NET_RX_SUCCESS;
Expand Down

0 comments on commit 57dc2b9

Please sign in to comment.