Skip to content

Commit

Permalink
6lowpan: fix process_data return values
Browse files Browse the repository at this point in the history
As process_data now returns just error codes fix up the calls to this
function to only drop the skb if an error code is returned.

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>
  • Loading branch information
Martin Townsend authored and Marcel Holtmann committed Oct 27, 2014
1 parent f8b3617 commit 04dfd73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion net/bluetooth/6lowpan.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
goto drop;

ret = process_data(local_skb, dev, chan);
if (ret != NET_RX_SUCCESS)
if (ret < 0)
goto drop;

local_skb->protocol = htons(ETH_P_IPV6);
Expand Down
6 changes: 3 additions & 3 deletions net/ieee802154/6lowpan_rtnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,15 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
switch (skb->data[0] & 0xe0) {
case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */
ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP)
if (ret < 0)
goto drop;

return lowpan_give_skb_to_devices(skb, NULL);
case LOWPAN_DISPATCH_FRAG1: /* first fragment header */
ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAG1);
if (ret == 1) {
ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP)
if (ret < 0)
goto drop;

return lowpan_give_skb_to_devices(skb, NULL);
Expand All @@ -563,7 +563,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN);
if (ret == 1) {
ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP)
if (ret < 0)
goto drop;

return lowpan_give_skb_to_devices(skb, NULL);
Expand Down

0 comments on commit 04dfd73

Please sign in to comment.