Commit 04dfd738 authored by Martin Townsend's avatar Martin Townsend Committed by Marcel Holtmann

6lowpan: fix process_data return values

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: default avatarMartin Townsend <mtownsend1973@gmail.com>
Acked-by: default avatarAlexander Aring <alex.aring@gmail.com>
Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent f8b36176
...@@ -347,7 +347,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev, ...@@ -347,7 +347,7 @@ static int recv_pkt(struct sk_buff *skb, struct net_device *dev,
goto drop; goto drop;
ret = process_data(local_skb, dev, chan); ret = process_data(local_skb, dev, chan);
if (ret != NET_RX_SUCCESS) if (ret < 0)
goto drop; goto drop;
local_skb->protocol = htons(ETH_P_IPV6); local_skb->protocol = htons(ETH_P_IPV6);
......
...@@ -542,7 +542,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -542,7 +542,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
switch (skb->data[0] & 0xe0) { switch (skb->data[0] & 0xe0) {
case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */ case LOWPAN_DISPATCH_IPHC: /* ipv6 datagram */
ret = process_data(skb, &hdr); ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP) if (ret < 0)
goto drop; goto drop;
return lowpan_give_skb_to_devices(skb, NULL); return lowpan_give_skb_to_devices(skb, NULL);
...@@ -550,7 +550,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -550,7 +550,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAG1); ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAG1);
if (ret == 1) { if (ret == 1) {
ret = process_data(skb, &hdr); ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP) if (ret < 0)
goto drop; goto drop;
return lowpan_give_skb_to_devices(skb, NULL); return lowpan_give_skb_to_devices(skb, NULL);
...@@ -563,7 +563,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -563,7 +563,7 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *dev,
ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN); ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN);
if (ret == 1) { if (ret == 1) {
ret = process_data(skb, &hdr); ret = process_data(skb, &hdr);
if (ret == NET_RX_DROP) if (ret < 0)
goto drop; goto drop;
return lowpan_give_skb_to_devices(skb, NULL); return lowpan_give_skb_to_devices(skb, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment