tcp: pass back data left in socket after receive
authorJens Axboe <axboe@kernel.dk>
Fri, 29 Apr 2022 00:45:06 +0000 (18:45 -0600)
committerJakub Kicinski <kuba@kernel.org>
Sat, 30 Apr 2022 01:55:27 +0000 (18:55 -0700)
commitf94fd25cb0aaf77fd7453f31c5d394a1a68ecf60
tree5a746a51c0bcfa087d4d0bc097c634e0e5c1b888
parentaf2d861d4cd2a4da5137f795ee3509e6f944a25b
tcp: pass back data left in socket after receive

This is currently done for CMSG_INQ, add an ability to do so via struct
msghdr as well and have CMSG_INQ use that too. If the caller sets
msghdr->msg_get_inq, then we'll pass back the hint in msghdr->msg_inq.

Rearrange struct msghdr a bit so we can add this member while shrinking
it at the same time. On a 64-bit build, it was 96 bytes before this
change and 88 bytes afterwards.

Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/r/650c22ca-cffc-0255-9a05-2413a1e20826@kernel.dk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/socket.h
net/ipv4/tcp.c