Skip to content

Commit

Permalink
6lowpan_rtnl: fix off by one while fragmentation
Browse files Browse the repository at this point in the history
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 d4b2816
("6lowpan: fix fragmentation").

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Aring authored and David S. Miller committed Jun 2, 2014
1 parent 51263ff commit eb06481
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ieee802154/6lowpan_rtnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb06481

Please sign in to comment.