tun: unbreak truncated packet signalling
authorJason Wang <jasowang@redhat.com>
Mon, 9 Dec 2013 10:25:16 +0000 (18:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Dec 2013 03:06:49 +0000 (22:06 -0500)
commit923347bb83c67c3a572b04decb5875c3adb0d306
tree90c725a751b4f1a964685cf73d486d53ae88d7e4
parentfffc15a5012e9052d3b236efc56840841a125416
tun: unbreak truncated packet signalling

Commit 6680ec68eff47d36f67b4351bc9836fd6cba9532
(tuntap: hardware vlan tx support) breaks the truncated packet signal by never
return a length greater than iov length in tun_put_user(). This patch fixes this
by always return the length of packet plus possible vlan header. Caller can
detect the truncated packet by comparing the return value and the size of iov
length.

Reported-by: Vlad Yasevich <vyasevich@gmail.com>
Cc: Vlad Yasevich <vyasevich@gmail.com>
Cc: Zhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tun.c