Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tun: return NET_XMIT_DROP for dropped packets

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>

authored by

Jason Wang and committed by
David S. Miller
baeababb e3e32170

+1 -1
+1 -1
drivers/net/tun.c
··· 819 819 skb_tx_error(skb); 820 820 kfree_skb(skb); 821 821 rcu_read_unlock(); 822 - return NETDEV_TX_OK; 822 + return NET_XMIT_DROP; 823 823 } 824 824 825 825 static void tun_net_mclist(struct net_device *dev)