[RFC 08/16] ieee802154: 6lowpan: change frag return value handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function lowpan_frag_rcv does return only:

 - "1": skb is reassmbled
 - "-1": skb is putted into the frag bucket or failure.

Other values can't happend. This patch will change that we return on "1"
the return value of netif_rx and "-1" to NET_RX_DROP, which means that
the packet doesn't reach the next layer.

Signed-off-by: Alexander Aring <alex.aring@xxxxxxxxx>
---
 net/ieee802154/6lowpan/rx.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/net/ieee802154/6lowpan/rx.c b/net/ieee802154/6lowpan/rx.c
index 3871804a..bf6e857 100644
--- a/net/ieee802154/6lowpan/rx.c
+++ b/net/ieee802154/6lowpan/rx.c
@@ -94,11 +94,9 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev,
 					goto drop_skb;
 
 				return lowpan_give_skb_to_device(skb);
-			} else if (ret == -1) {
-				return NET_RX_DROP;
-			} else {
-				return NET_RX_SUCCESS;
 			}
+
+			return NET_RX_DROP;
 		case LOWPAN_DISPATCH_FRAGN:	/* next fragments headers */
 			ret = lowpan_frag_rcv(skb, LOWPAN_DISPATCH_FRAGN);
 			if (ret == 1) {
@@ -107,11 +105,9 @@ static int lowpan_rcv(struct sk_buff *skb, struct net_device *wdev,
 					goto drop_skb;
 
 				return lowpan_give_skb_to_device(skb);
-			} else if (ret == -1) {
-				return NET_RX_DROP;
-			} else {
-				return NET_RX_SUCCESS;
 			}
+
+			return NET_RX_DROP;
 		default:
 			break;
 		}
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux