6lowpan: consider checksum bytes in fragmentation threshold
authorAlan Ott <alan@signal11.us>
Thu, 29 Nov 2012 15:55:44 +0000 (15:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Nov 2012 17:19:24 +0000 (12:19 -0500)
Change the threshold for framentation of a lowpan packet from
using the MTU size to now use the MTU size minus the checksum length,
which is added by the hardware. For IEEE 802.15.4, this effectively
changes it from 127 bytes to 125 bytes.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ieee802154/6lowpan.c

index 6d42c17af96b4a606a545d2d72ad5e32cb53c3da..f651da60f1618f089c2d21eef069ac5b3648218d 100644 (file)
@@ -1047,7 +1047,8 @@ static netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev)
                goto error;
        }
 
-       if (skb->len <= IEEE802154_MTU) {
+       /* Send directly if less than the MTU minus the 2 checksum bytes. */
+       if (skb->len <= IEEE802154_MTU - IEEE802154_MFR_SIZE) {
                err = dev_queue_xmit(skb);
                goto out;
        }