Change in ...libosmo-abis[master]: add TCP_USER_TIMEOUT to keepalive

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Hoernchen gerrit-no-reply at lists.osmocom.org
Fri Jun 21 15:24:41 UTC 2019


Hoernchen has submitted this change and it was merged. ( https://gerrit.osmocom.org/c/libosmo-abis/+/14565 )

Change subject: add TCP_USER_TIMEOUT to keepalive
......................................................................

add TCP_USER_TIMEOUT to keepalive

The patch sets TCP_USER_TIMEOUT to the same timeout value,
since keepalive only applies to idle connections, but we obviously want
to fail as fast as possible even if there is data to send and it's not
acked.

Change-Id: I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f
---
M src/input/ipaccess.c
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index d0fa023..fb6ad10 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -459,6 +459,17 @@
 			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;
+                ret = setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT,
+                                 &val, sizeof(val));
+                if (ret < 0)
+                        LOGP(DLINP, LOGL_NOTICE,
+                             "Failed to set user timoeut: %s\n",
+                             strerror(errno));
+#endif
 #endif
 	}
 }

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/14565
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f
Gerrit-Change-Number: 14565
Gerrit-PatchSet: 2
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at gnumonks.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190621/0fab05b7/attachment.htm>


More information about the gerrit-log mailing list