diff options
author | 2025-05-22 01:18:22 +0200 | |
---|---|---|
committer | 2025-05-27 11:05:21 +0200 | |
commit | 5ec40864aaecc4bd66fe67541d4a41091ed664a5 (patch) | |
tree | 2385f434eeb0f735e308b4f3c0ca2078e989f5eb /include | |
parent | vsock/virtio: Linger on unsent data (diff) | |
download | wireguard-linux-5ec40864aaecc4bd66fe67541d4a41091ed664a5.tar.xz wireguard-linux-5ec40864aaecc4bd66fe67541d4a41091ed664a5.zip |
vsock: Move lingering logic to af_vsock core
Lingering should be transport-independent in the long run. In preparation
for supporting other transports, as well as the linger on shutdown(), move
code to core.
Generalize by querying vsock_transport::unsent_bytes(), guard against the
callback being unimplemented. Do not pass sk_lingertime explicitly. Pull
SOCK_LINGER check into vsock_linger().
Flatten the function. Remove the nested block by inverting the condition:
return early on !timeout.
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Link: https://patch.msgid.link/20250522-vsock-linger-v6-2-2ad00b0e447e@rbox.co
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/af_vsock.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h index 9e85424c8343..d56e6e135158 100644 --- a/include/net/af_vsock.h +++ b/include/net/af_vsock.h @@ -221,6 +221,7 @@ void vsock_for_each_connected_socket(struct vsock_transport *transport, void (*fn)(struct sock *sk)); int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk); bool vsock_find_cid(unsigned int cid); +void vsock_linger(struct sock *sk); /**** TAP ****/ |