]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
No per-socket TCP keepidle on OpenBSD 1794/head
authorKlemens Nanni <kn@openbsd.org>
Sat, 27 Jan 2024 18:15:07 +0000 (19:15 +0100)
committerKlemens Nanni <klemens@posteo.de>
Sat, 27 Jan 2024 18:15:07 +0000 (19:15 +0100)
A system-wide sysctl(2) net.inet.tcp.keepidle exists, but there is no
setsockopt(2) equivalent.

definitions.h
rtsp.c

index f626302611aebc8bfcf35557fff619a8e0e70e8d..3eeaf79c73793420f1dc44a824947e99e75fe99e 100644 (file)
 #define COMPILE_FOR_FREEBSD 1
 #endif
 
+#if defined(__OpenBSD__)
+#define COMPILE_FOR_OPENBSD 1
+#endif
+
 // struct sockaddr_in6 is bigger than struct sockaddr. derp
 #ifdef AF_INET6
 #define SOCKADDR struct sockaddr_storage
diff --git a/rtsp.c b/rtsp.c
index b9992366fddc2cf0f8361b1ac801fb108a6b2950..6ac850504305f16f948b0a5b0e4d490ae3fd13d2 100644 (file)
--- a/rtsp.c
+++ b/rtsp.c
@@ -5623,6 +5623,7 @@ void *rtsp_listen_loop(__attribute((unused)) void *arg) {
 #define KEEP_ALIVE_OR_IDLE_OPTION TCP_KEEPIDLE
 #endif
 
+#ifndef COMPILE_FOR_OPENBSD
           if (setsockopt(conn->fd, SOL_OPTION, KEEP_ALIVE_OR_IDLE_OPTION,
                          (void *)&keepAliveIdleTime, sizeof(keepAliveIdleTime))) {
             debug(1, "can't set the keepidle wait time");
@@ -5636,6 +5637,7 @@ void *rtsp_listen_loop(__attribute((unused)) void *arg) {
                          sizeof(keepAliveInterval))) {
             debug(1, "can't set the keepidle missing count interval");
           };
+#endif
 
           // initialise the connection info
           void *client_addr = NULL, *self_addr = NULL;