]> git.baikalelectronics.ru Git - kernel.git/commit
tun: Fix TUN_PKT_STRIP setting
authorHerbert Xu <herbert@gondor.apana.org.au>
Sun, 2 Nov 2014 20:30:14 +0000 (04:30 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Nov 2014 19:27:06 +0000 (14:27 -0500)
commit4025451543b4fb923f8decee6886c4ce49abc06e
tree15b3ea5b89ea7f75965d3ce1c4eba43d69c182c6
parent25654b1a22e95b3fe1106ced4211ed9a0067097d
tun: Fix TUN_PKT_STRIP setting

We set the flag TUN_PKT_STRIP if the user buffer provided is too
small to contain the entire packet plus meta-data.  However, this
has been broken ever since we added GSO meta-data.  VLAN acceleration
also has the same problem.

This patch fixes this by taking both into account when setting the
TUN_PKT_STRIP flag.

The fact that this has been broken for six years without anyone
realising means that nobody actually uses this flag.

Fixes: 340bf86a628c ("tun: Allow GSO using virtio_net_hdr")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c