laforge has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-abis/+/36038?usp=email )
Change subject: input/ipaccess: Makes sure to say "TCP keepalive"
......................................................................
input/ipaccess: Makes sure to say "TCP keepalive"
We have TCP and IPA keepalive. Reading a message like
"input/ipaccess.c:612 Keepalive is set: 0" is misleading, as one might
assume it relates to IPA.
Be explicit.
Related: SYS#6801
Change-Id: I01cbda27eb7826eb11f44e034d746b7c39b399a4
---
M src/input/ipaccess.c
1 file changed, 29 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/38/36038/1
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 7cb16ad..7b17f87 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -595,9 +595,9 @@
val = 1;
ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val));
if (ret < 0)
- LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set keepalive: %s\n",
strerror(errno));
+ LOGPIL(line, DLINP, LOGL_ERROR, "Failed to enable TCP keepalive: %s\n",
strerror(errno));
else
- LOGPIL(line, DLINP, LOGL_NOTICE, "Keepalive is set: %i\n", ret);
+ LOGPIL(line, DLINP, LOGL_NOTICE, "TCP Keepalive is enabled\n");
/* The following options are not portable! */
val = line->keepalive_idle_timeout > 0 ?
@@ -605,29 +605,33 @@
DEFAULT_TCP_KEEPALIVE_IDLE_TIMEOUT;
ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE,
&val, sizeof(val));
- if (ret < 0)
- LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set keepalive idle time: %s\n",
strerror(errno));
+ if (ret < 0) {
+ LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP keepalive idle time:
%s\n",
+ strerror(errno));
+ }
val = line->keepalive_probe_interval > -1 ?
line->keepalive_probe_interval :
DEFAULT_TCP_KEEPALIVE_INTERVAL;
ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL,
&val, sizeof(val));
- if (ret < 0)
- LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set keepalive interval: %s\n",
strerror(errno));
+ if (ret < 0) {
+ LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP keepalive interval:
%s\n",
+ strerror(errno));
+ }
val = line->keepalive_num_probes > 0 ?
line->keepalive_num_probes :
DEFAULT_TCP_KEEPALIVE_RETRY_COUNT;
ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT,
&val, sizeof(val));
if (ret < 0)
- LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set keepalive count: %s\n",
strerror(errno));
+ LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP keepalive count: %s\n",
strerror(errno));
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)
- LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set user timoeut: %s\n",
strerror(errno));
+ LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP user timeout: %s\n",
strerror(errno));
}
val = 1;
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-abis/+/36038?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I01cbda27eb7826eb11f44e034d746b7c39b399a4
Gerrit-Change-Number: 36038
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange