stud (0.3-3) kfreebsd-no-keepidle.patch

Summary

 stud.c |    2 ++
 1 file changed, 2 insertions(+)

    
download this patch

Patch contents

Description: fix compilation on kFreeBSD for which TCP_KEEPIDLE is not available
Author: Vincent Bernat <bernat@debian.org>

diff --git a/stud.c b/stud.c
index 4b76cba..62b3dc5 100644
--- a/stud.c
+++ b/stud.c
@@ -201,11 +201,13 @@ static void settcpkeepalive(int fd) {
         ERR("Error activating SO_KEEPALIVE on client socket: %s", strerror(errno));
     }
 
+#ifdef TCP_KEEPIDLE
     optval = OPTIONS.TCP_KEEPALIVE;
     optlen = sizeof(optval);
     if(setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
         ERR("Error setting TCP_KEEPIDLE on client socket: %s", strerror(errno));
     }
+#endif
 }
 
 static void fail(const char* s) {