From 5761d2d1772737e404825f1f09a601cb78c4fbe0 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Mon, 2 Jun 2014 13:21:58 +0200 Subject: [PATCH] 6lowpan_rtnl: fix off by one while fragmentation This patch fix a off by one error while fragmentation. If the frag_cap value is equal to skb_unprocessed value we need to stop the fragmentation loop because the last fragment which has a size of skb_unprocessed fits into the frag capability size. This issue was introduced by commit 87c96229bf437c70dbaedc1b8b8805a2997f930c ("6lowpan: fix fragmentation"). Signed-off-by: Alexander Aring Signed-off-by: David S. Miller --- net/ieee802154/6lowpan_rtnl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index 9d57026fd9d5f..fe6bd7a710816 100644 --- a/net/ieee802154/6lowpan_rtnl.c +++ b/net/ieee802154/6lowpan_rtnl.c @@ -328,7 +328,7 @@ lowpan_xmit_fragmented(struct sk_buff *skb, struct net_device *dev, __func__, frag_tag, skb_offset); goto err; } - } while (skb_unprocessed >= frag_cap); + } while (skb_unprocessed > frag_cap); consume_skb(skb); return NET_XMIT_SUCCESS; -- 2.39.5