From 9b64495c6cd22cd65f118c18a36b2de7cbde4344 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 5 Jul 2020 17:09:58 +0200 Subject: pflocal: support SO_SNDBUF for unconnected sockets We can store the requested value, to be applied when we connect the sockets. * pflocal/sock.h (struct sock): Add req_write_limit field. * pflocal/sock.c (sock_create): Initialize req_write_limit field to 0. (sock_connect): Bump the write_limit of the write pipe to the req_write_limit value. (sock_shutdown): Update req_write_limit from the write_limit of the write pipe. * pflocal/socket.c (S_socket_getopt, S_socket_setopt): When write_pipe is NULL, use req_write_limit. --- pflocal/sock.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pflocal/sock.h') diff --git a/pflocal/sock.h b/pflocal/sock.h index dca16755..c1e73f9b 100644 --- a/pflocal/sock.h +++ b/pflocal/sock.h @@ -52,6 +52,9 @@ struct sock another socket. */ struct pipe *read_pipe, *write_pipe; + /* The write limit that this side would like write_pipe to support. */ + size_t req_write_limit; + /* FLAGS from SOCK_*, below. */ unsigned flags; -- cgit v1.2.3