aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2022-11-23 14:05:26 +0100
committerOliver Smith <osmith@sysmocom.de>2022-11-23 14:05:26 +0100
commitfa19b2d9dbfc1c849dfb721bcf54309eecb53d14 (patch)
tree8dec589725f5dbbe1df9ab279666b972aa137cb8
parentef0f7c25f04573b07b6f629545881d568fe76220 (diff)
ipaccess: require tcp keepalive related defines
Fail the compilation if TCP_KEEPIDLE, TCP_KEEPINTVL, TCP_KEEPCNT or TCP_USER_TIMEOUT are not defined. Harald wrote: > What we want to prevent is the user configuring timeouts, assuming > they would be installed into the kernel TCP stack, which then simply > end up no-ops becaus somehow the libc didn't define them or the right > #include file was not present at compile time. > > [...] Apparently TCP_KEEP{IDLE,INTVL,CNT} were introduced with kernel > 2.4 and TCP_USER_TIMEOUT with 2.6.37. I think it's fair to say that > using a modern/master libosmo-* on such old systems might fail for > various other reasons (eventfd, ...) and cannot be considered a valid > configuration anyway. Closes: OS#5786 Change-Id: Idc0ff1ff02ce4b994692d8213c14c0b2caad756e
-rw-r--r--src/input/ipaccess.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 42dd942..3a20967 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -610,7 +610,6 @@ static void update_fd_settings(struct e1inp_line *line, int fd)
else
LOGP(DLINP, LOGL_NOTICE, "Keepalive is set: %i\n", ret);
-#if defined(TCP_KEEPIDLE) && defined(TCP_KEEPINTVL) && defined(TCP_KEEPCNT)
/* The following options are not portable! */
val = line->keepalive_idle_timeout > 0 ?
line->keepalive_idle_timeout :
@@ -639,7 +638,6 @@ static void update_fd_settings(struct e1inp_line *line, int fd)
LOGP(DLINP, LOGL_NOTICE,
"Failed to set keepalive count: %s\n",
strerror(errno));
-#if defined(TCP_USER_TIMEOUT)
val = 1000 * line->keepalive_num_probes *
line->keepalive_probe_interval +
line->keepalive_idle_timeout;
@@ -649,8 +647,6 @@ static void update_fd_settings(struct e1inp_line *line, int fd)
LOGP(DLINP, LOGL_NOTICE,
"Failed to set user timoeut: %s\n",
strerror(errno));
-#endif
-#endif
}
val = 1;