From: Alexander Aring Date: Mon, 2 Jun 2014 11:21:58 +0000 (+0200) Subject: 6lowpan_rtnl: fix off by one while fragmentation X-Git-Tag: v4.9.8~6250^2~104^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb06481d69c60f6f9318e935053dce13fe3e8951;p=platform%2Fkernel%2Flinux-rpi3.git 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 d4b2816d67d6e07b2f27037f282d8db03a5829d7 ("6lowpan: fix fragmentation"). Signed-off-by: Alexander Aring Signed-off-by: David S. Miller --- diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c index 9d57026..fe6bd7a 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;