]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: really ignore MSG_ZEROCOPY if no SO_ZEROCOPY
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Thu, 6 Sep 2018 13:54:59 +0000 (15:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 8 Sep 2018 06:11:06 +0000 (23:11 -0700)
commit660a65d34a695e95347c460c3f88d1a4e3275ed3
treec3a217b0a679c4821e045f32ddfff995b0dc5b9d
parentea90e2ae1bf15113d3d788bd182c3326f871f76e
tcp: really ignore MSG_ZEROCOPY if no SO_ZEROCOPY

According to the documentation in msg_zerocopy.rst, the SO_ZEROCOPY
flag was introduced because send(2) ignores unknown message flags and
any legacy application which was accidentally passing the equivalent of
MSG_ZEROCOPY earlier should not see any new behaviour.

Before commit e46e1dc69a94 ("tcp: enable MSG_ZEROCOPY"), a send(2) call
which passed the equivalent of MSG_ZEROCOPY without setting SO_ZEROCOPY
would succeed.  However, after that commit, it fails with -ENOBUFS.  So
it appears that the SO_ZEROCOPY flag fails to fulfill its intended
purpose.  Fix it.

Fixes: e46e1dc69a94 ("tcp: enable MSG_ZEROCOPY")
Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c
net/ipv4/tcp.c