Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email )
Change subject: Fix critical bug in default TCP keepalive user timeout
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/libosmo-abis/+/36079/comment/d762b6f1_8228f661
PS2, Line 22: Ia7659c209aea0d26eb37d31e771adc91b17ae668
This commit (https://gerrit.osmocom.org/c/libosmo-abis/+/30280) does not introduce the regression itself; it does enable the keepalive feature by default. The buggy logic was added in `I5e7425958472aa5d758e09bfbefc7d7d37bf6f5f` (https://gerrit.osmocom.org/c/libosmo-abis/+/14565). And so the bug is present since 0.7.0 (Jun 2019).
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?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: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf
Gerrit-Change-Number: 36079
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sat, 24 Feb 2024 13:10:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email )
Change subject: [cosmetic] re-order hnbgw.c to group code in major blocks
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-hnbgw/hnbgw.c:
Robot Comment from checkpatch (run ID jenkins-gerrit-lint-14663):
https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080/comment/8face840_2bd10288
PS1, Line 272: * SCTP Socket / stream handling
trailing whitespace
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/36080?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ce60e6f80d10b7712de1aa6d8a30dd61690dcc
Gerrit-Change-Number: 36080
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Sat, 24 Feb 2024 11:40:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Fix critical bug in default TCP keepalive user timeout
......................................................................
Fix critical bug in default TCP keepalive user timeout
It turns out that our calculation of the TCP_USER_TIMEOUT value was
flawed in several ways:
* there should have been parenthesis around the + operator
(line->keepalive_probe_interval + line->keepalive_idle_timeout) as the
keepalive_idle_timeout is in seconds, not milli-seconds.
* in the default case, all those values are configured to -1
(E1INP_USE_DEFAULT). This means we're using
1000 * -1 * -1 + -1 = 999
i.e. just below aq second which clearly is not enough for a lossy
satellite or wifi back-haul.
This fixes a regression introduced in Ia7659c209aea0d26eb37d31e771adc91b17ae668
i.e. present since libosmo-abis 1.4.0
In addition, let's print the actually-used values to the log, helping to
spot unintended values.
Change-Id: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf
Closes: OS#6375
Related: OS#5785, SYS#6801
Fixes: Ia7659c209aea0d26eb37d31e771adc91b17ae668
---
M src/input/ipaccess.c
1 file changed, 48 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/79/36079/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?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: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf
Gerrit-Change-Number: 36079
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/36079?usp=email )
Change subject: Fix critical bug in default TCP keepalive user timeout
......................................................................
Fix critical bug in default TCP keepalive user timeout
It turns out that our calculation of the TCP_USER_TIMEOUT value was
flawed in several ways:
* there should have been parenthesis around the + operator
(line->keepalive_probe_interval + line->keepalive_idle_timeout) as the
keepalive_idle_timeout is in seconds, not milli-seconds.
* in the default case, all those values are configured to -1
(E1INP_USE_DEFAULT). This means we're using
1000 * -1 * -1 + -1 = 999
i.e. just below aq second which clearly is not enough for a lossy
satellite or wifi back-haul.
This fixes a regression introduced in Ia7659c209aea0d26eb37d31e771adc91b17ae668
i.e. present since libosmo-abis 1.4.0
Change-Id: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf
Related: OS#5785, SYS#6801
Fixes: Ia7659c209aea0d26eb37d31e771adc91b17ae668
---
M src/input/ipaccess.c
1 file changed, 41 insertions(+), 16 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/79/36079/1
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 75d9693..7979b7b 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -588,7 +588,7 @@
static void update_fd_settings(struct e1inp_line *line, int fd)
{
int ret;
- int val;
+ int val, timeout_val, interval_val, retry_count_val;
if (line->keepalive_num_probes) {
/* Enable TCP keepalive to find out if the connection is gone */
@@ -600,31 +600,29 @@
LOGPIL(line, DLINP, LOGL_NOTICE, "TCP Keepalive is enabled\n");
/* The following options are not portable! */
- val = line->keepalive_idle_timeout > 0 ?
- line->keepalive_idle_timeout :
- DEFAULT_TCP_KEEPALIVE_IDLE_TIMEOUT;
- ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val));
+ timeout_val = line->keepalive_idle_timeout > 0 ?
+ line->keepalive_idle_timeout :
+ DEFAULT_TCP_KEEPALIVE_IDLE_TIMEOUT;
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &timeout_val, sizeof(timeout_val));
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));
+ interval_val = line->keepalive_probe_interval > -1 ?
+ line->keepalive_probe_interval :
+ DEFAULT_TCP_KEEPALIVE_INTERVAL;
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &interval_val, sizeof(interval_val));
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));
+ retry_count_val = line->keepalive_num_probes > 0 ?
+ line->keepalive_num_probes :
+ DEFAULT_TCP_KEEPALIVE_RETRY_COUNT;
+ ret = setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &retry_count_val, sizeof(retry_count_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 * retry_count_val * (interval_val + timeout_val);
ret = setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &val, sizeof(val));
if (ret < 0)
LOGPIL(line, DLINP, LOGL_ERROR, "Failed to set TCP user timeout: %s\n", strerror(errno));
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/36079?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: Idca24d3e676a45d860d9eec60dc2097d8d87f3bf
Gerrit-Change-Number: 36079
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/36076?usp=email )
Change subject: osmo_io: Add osmo_io_get_ioops() function
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File include/osmocom/core/osmo_io.h:
https://gerrit.osmocom.org/c/libosmocore/+/36076/comment/3c07305a_ad1f92bd
PS1, Line 112: void osmo_iofd_get_ioops(struct osmo_io_fd *iofd, struct osmo_io_ops *ioops);
It may make more sense to return a "const struct osmo_io_ops*" so that no copy is needed by default. This also means the struct is not allocated by the user, which may be an advantage if the struct size changes?
Not a strong opinion though, just raising the topic.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/36076?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I03398c811b9534f50c6644b21eea89a04be29fb0
Gerrit-Change-Number: 36076
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Fri, 23 Feb 2024 19:55:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment