tun: return NET_XMIT_DROP for dropped packets
authorJason Wang <jasowang@redhat.com>
Tue, 18 Nov 2014 05:20:41 +0000 (13:20 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Nov 2014 19:43:47 +0000 (14:43 -0500)
After commit 5d097109257c03a71845729f8db6b5770c4bbedc
("tun: only queue packets on device"), NETDEV_TX_OK was returned for
dropped packets. This will confuse pktgen since dropped packets were
counted as sent ones.

Fixing this by returning NET_XMIT_DROP to let pktgen count it as error
packet.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c

index e3fa65a4d96cd725b6475dc670946825c8421c01..ac53a7316ecd55b5b081072f4e16e3e09b3625be 100644 (file)
@@ -819,7 +819,7 @@ drop:
        skb_tx_error(skb);
        kfree_skb(skb);
        rcu_read_unlock();
-       return NETDEV_TX_OK;
+       return NET_XMIT_DROP;
 }
 
 static void tun_net_mclist(struct net_device *dev)