aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/6lowpan.c
diff options
context:
space:
mode:
authorMartin Townsend <mtownsend1973@gmail.com>2014-10-23 10:40:53 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-10-27 10:51:15 -0400
commitf8b361768ea2eaf9b21dfbe7388958ec31798c8b (patch)
treee2b9ea93b72fbf33d6f9ee84a7fc63edfaba8c92 /net/bluetooth/6lowpan.c
parentf81f466ca588a5bd868008154050305481f241d4 (diff)
6lowpan: remove skb_deliver from IPHC
Separating skb delivery from decompression ensures that we can support further decompression schemes and removes the mixed return value of error codes with NET_RX_FOO. Signed-off-by: Martin Townsend <mtownsend1973@gmail.com> Acked-by: Alexander Aring <alex.aring@gmail.com> Acked-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
-rw-r--r--net/bluetooth/6lowpan.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 6c5c2eff45bd..45d9a9fef634 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -252,7 +252,7 @@ static int give_skb_to_upper(struct sk_buff *skb, struct net_device *dev)
252 252
253 skb_cp = skb_copy(skb, GFP_ATOMIC); 253 skb_cp = skb_copy(skb, GFP_ATOMIC);
254 if (!skb_cp) 254 if (!skb_cp)
255 return -ENOMEM; 255 return NET_RX_DROP;
256 256
257 return netif_rx(skb_cp); 257 return netif_rx(skb_cp);
258} 258}
@@ -290,7 +290,7 @@ static int process_data(struct sk_buff *skb, struct net_device *netdev,
290 return lowpan_process_data(skb, netdev, 290 return lowpan_process_data(skb, netdev,
291 saddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN, 291 saddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
292 daddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN, 292 daddr, IEEE802154_ADDR_LONG, EUI64_ADDR_LEN,
293 iphc0, iphc1, give_skb_to_upper); 293 iphc0, iphc1);
294 294
295drop: 295drop:
296 kfree_skb(skb); 296 kfree_skb(skb);
@@ -350,6 +350,16 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
350 if (ret != NET_RX_SUCCESS) 350 if (ret != NET_RX_SUCCESS)
351 goto drop; 351 goto drop;
352 352
353 local_skb->protocol = htons(ETH_P_IPV6);
354 local_skb->pkt_type = PACKET_HOST;
355 local_skb->dev = dev;
356
357 if (give_skb_to_upper(local_skb, dev)
358 != NET_RX_SUCCESS) {
359 kfree_skb(local_skb);
360 goto drop;
361 }
362
353 dev->stats.rx_bytes += skb->len; 363 dev->stats.rx_bytes += skb->len;
354 dev->stats.rx_packets++; 364 dev->stats.rx_packets++;
355 365