osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/30281 )
Change subject: ipaccess: require tcp keepalive related defines ......................................................................
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 --- M src/input/ipaccess.c 1 file changed, 0 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/81/30281/1
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 @@ 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 @@ 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 @@ LOGP(DLINP, LOGL_NOTICE, "Failed to set user timoeut: %s\n", strerror(errno)); -#endif -#endif }
val = 1;