diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-05-09 17:35:01 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-05-14 02:19:20 +0200 |
commit | 7951e36ac620a9ba1bae0ac0ddd62d2e82285725 (patch) | |
tree | 1154f51ffebda2c624b11f73755dda2a86bc4b7d /include/net/sock.h | |
parent | net: have do_accept() take a struct proto_accept_arg argument (diff) | |
download | linux-7951e36ac620a9ba1bae0ac0ddd62d2e82285725.tar.xz linux-7951e36ac620a9ba1bae0ac0ddd62d2e82285725.zip |
net: pass back whether socket was empty post accept
This adds an 'is_empty' argument to struct proto_accept_arg, which can
be used to pass back information on whether or not the given socket has
more connections to accept post the one just accepted.
To utilize this information, the caller should initialize the 'is_empty'
field to, eg, -1 and then check for 0/1 after the accept. If the field
has been set, the caller knows whether there are more pending connections
or not. If the field remains -1 after the accept call, the protocol
doesn't support passing back this information.
This patch wires it up for ipv4/6 TCP.
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r-- | include/net/sock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index 217079b3e3e8..5f4d0629348f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -1197,6 +1197,7 @@ static inline void sk_prot_clear_nulls(struct sock *sk, int size) struct proto_accept_arg { int flags; int err; + int is_empty; bool kern; }; |