Don't count RTR DLC as sent bytes
authornorly <ny-git@enpas.org>
Sun, 12 Jun 2022 13:49:27 +0000 (15:49 +0200)
committernorly <ny-git@enpas.org>
Sun, 12 Jun 2022 13:49:27 +0000 (15:49 +0200)
RTR frames don't actually carry data, so bytes sent is 0.

module/can327.c

index 799905fd2d29fc4fa48fa3e96c03f8e08bd11b25..82dbc668271e21f4696f1c9de7eb812d3cc4347b 100644 (file)
@@ -887,7 +887,7 @@ static netdev_tx_t can327_netdev_start_xmit(struct sk_buff *skb,
        spin_unlock(&elm->lock);
 
        dev->stats.tx_packets++;
-       dev->stats.tx_bytes += frame->len;
+       dev->stats.tx_bytes += frame->can_id & CAN_RTR_FLAG ? 0 : frame->len;
 
 out:
        kfree_skb(skb);