laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36041?usp=email )
Change subject: [cosmetic] input/ipaccess.c: We use tab indent, not spaces [wtf]
......................................................................
[cosmetic] input/ipaccess.c: We use tab indent, not spaces [wtf]
Change-Id: I6ba728ccf7f6d81dc42d1ff82a29b557752e80ba
---
M src/input/ipaccess.c
1 file changed, 15 insertions(+), 6 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 04244a6..75d9693 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -622,11 +622,11 @@
ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &val, sizeof(val));
if (ret < 0)
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;
+ 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)
+ if (ret < 0)
LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP user timeout: %s\n", strerror(errno));
}
@@ -697,8 +697,8 @@
struct osmo_fd *bfd;
int i, ret;
- /* We don't know yet which OML link to associate it with. Thus, we
- * allocate a temporary E1 line until we have received ID. */
+ /* We don't know yet which OML link to associate it with. Thus, we
+ * allocate a temporary E1 line until we have received ID. */
line = e1inp_line_clone(tall_ipa_ctx, link->line, "ipa_bfd");
if (line == NULL) {
LOGP(DLINP, LOGL_ERROR, "could not clone E1 line\n");
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36041?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: I6ba728ccf7f6d81dc42d1ff82a29b557752e80ba
Gerrit-Change-Number: 36041
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36036?usp=email )
Change subject: ipa_keepalive: Make FSM a bit less quiet
......................................................................
ipa_keepalive: Make FSM a bit less quiet
Let's make sure we log meaningful log messages whenever an IPA keepalive
FSM is started, stopped or if it times out. This allows the user to
observe whether IPA keepalive is actually enabled (using what timeout),
and also to learn why exactly the connection was dropped.
Change-Id: Iad20b86f893c1036affaf14f978099fa858a0031
Related: SYS#6801
---
M src/input/ipa_keepalive.c
1 file changed, 20 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/src/input/ipa_keepalive.c b/src/input/ipa_keepalive.c
index 7fc28f1..de68879 100644
--- a/src/input/ipa_keepalive.c
+++ b/src/input/ipa_keepalive.c
@@ -147,6 +147,7 @@
ifp->params.wait_for_resp, T_PONG_NOT_RECEIVED);
return 0;
case T_PONG_NOT_RECEIVED:
+ LOGPFSML(fi, LOGL_NOTICE, "IPA keep-alive FSM timed out: PONG not received\n");
/* PONG not received within time */
if (ifp->srv_conn)
conn = ifp->srv_conn;
@@ -320,7 +321,10 @@
/*! Start the ping/pong procedure of the IPA Keepalive FSM. */
void ipa_keepalive_fsm_start(struct osmo_fsm_inst *fi)
{
+ struct ipa_fsm_priv *ifp = fi->priv;
OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm);
+ LOGPFSML(fi, LOGL_INFO, "Starting IPA keep-alive FSM (interval=%us wait=%us)\n",
+ ifp->params.interval, ifp->params.wait_for_resp);
osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_START, NULL);
}
@@ -328,5 +332,6 @@
void ipa_keepalive_fsm_stop(struct osmo_fsm_inst *fi)
{
OSMO_ASSERT(fi->fsm == &ipa_keepalive_fsm);
+ LOGPFSML(fi, LOGL_INFO, "Stopping IPA keep-alive FSM\n");
osmo_fsm_inst_dispatch(fi, OSMO_IPA_KA_E_STOP, NULL);
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36036?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: Iad20b86f893c1036affaf14f978099fa858a0031
Gerrit-Change-Number: 36036
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( 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(-)
Approvals:
pespin: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 9010f89..41e8b89 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: %d\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: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36037?usp=email )
Change subject: input/ipaccess: Always log with context, if we have any
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36037?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: I5cd84c2d69c0db3be296cb5d9a62720f7b2c827e
Gerrit-Change-Number: 36037
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 23 Feb 2024 08:16:45 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36036?usp=email )
Change subject: ipa_keepalive: Make FSM a bit less quiet
......................................................................
Patch Set 3: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36036?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: Iad20b86f893c1036affaf14f978099fa858a0031
Gerrit-Change-Number: 36036
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 23 Feb 2024 08:16:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment