summaryrefslogtreecommitdiff
path: root/src/basic/socket-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-11-16 12:41:23 +0100
committerLennart Poettering <lennart@poettering.net>2020-12-07 13:46:35 +0100
commit00ed2fff1a87372e6af37398f48527d75c00339c (patch)
treed68a6712c1da396a63c9b5436296d9672401d0f5 /src/basic/socket-util.h
parente0f90ad98802a43addd40f7f8ef69118d04f4cd2 (diff)
downloadsystemd-00ed2fff1a87372e6af37398f48527d75c00339c.tar.gz
socket-util: add sockopt helper for controlling IP_RECVFRAGSIZE
Diffstat (limited to 'src/basic/socket-util.h')
-rw-r--r--src/basic/socket-util.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h
index e353f82a42..7d77144f43 100644
--- a/src/basic/socket-util.h
+++ b/src/basic/socket-util.h
@@ -266,6 +266,7 @@ ssize_t recvmsg_safe(int sockfd, struct msghdr *msg, int flags);
int socket_get_family(int fd, int *ret);
int socket_set_recvpktinfo(int fd, int af, bool b);
int socket_set_unicast_if(int fd, int af, int ifi);
+
int socket_set_option(int fd, int af, int opt_ipv4, int opt_ipv6, int val);
static inline int socket_set_recverr(int fd, int af, bool b) {
return socket_set_option(fd, af, IP_RECVERR, IPV6_RECVERR, b);
@@ -282,3 +283,6 @@ static inline int socket_set_freebind(int fd, int af, bool b) {
static inline int socket_set_transparent(int fd, int af, bool b) {
return socket_set_option(fd, af, IP_TRANSPARENT, IPV6_TRANSPARENT, b);
}
+static inline int socket_set_recvfragsize(int fd, int af, bool b) {
+ return socket_set_option(fd, af, IP_RECVFRAGSIZE, IPV6_RECVFRAGSIZE, b);
+}