Attention is currently required from: pespin, keith, dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/32374 )
Change subject: e1d: reconnect to osmo-e1d after connection loss
......................................................................
Patch Set 11:
(5 comments)
File src/input/e1d.c:
https://gerrit.osmocom.org/c/libosmo-abis/+/32374/comment/adeb34c6_6888d863
PS11, Line 340: osmo_fsm
the question to me is if we really want to call this on every "short read", or just in case of ret <= 0. If *some* amount of data was read, the socket is not dead yet.
In osmo-e1d, the socket in E1_TS_MODE_RAW is a SOCK_STREAM socket, so in theory, depending on operating system scheduling, you could receive any number of bytes (up to D_TSX_ALLOC_SIZE), and it would be perfectly legal.
https://gerrit.osmocom.org/c/libosmo-abis/+/32374/comment/fd09ffa0_a1e8bcdf
PS11, Line 391: osmo_fsm
likewise here, a SOCK_STREAM socket might in theory do a successful write of any size, if the socket buffer/queue is full. "<= 0" should be the condition for connection loss, not "< msg->len"
https://gerrit.osmocom.org/c/libosmo-abis/+/32374/comment/412acc5a_48e8435c
PS11, Line 414: osmo_fsm
same as above
https://gerrit.osmocom.org/c/libosmo-abis/+/32374/comment/943d6248_e266ac18
PS11, Line 451: osmo_fsm
here I think the existing implementation is OK, as a HDLC socket is an E1_TS_MODE_HDLCFCS socket, which is SOCK_SEQPACKET and not SOCK_STREAM.
https://gerrit.osmocom.org/c/libosmo-abis/+/32374/comment/39f1daca_b3ddea3d
PS11, Line 476: osmo_fsm_inst_dispatch(g_e1d_fsm_inst, EV_CONN_LOST, line);
I'm not sure about the exact semantics of SOCK_SEQPACKET here, but I would assume that a zero-length read (after select/poll has told us data is available) is a "socket closed" indication, so it should be "<= 0" ?
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/32374
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Iaf4d42c2f009b1d7666e319fabdeb2598aa0b338
Gerrit-Change-Number: 32374
Gerrit-PatchSet: 11
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: keith <keith(a)rhizomatica.org>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-CC: tnt <tnt(a)246tNt.com>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: keith <keith(a)rhizomatica.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 09 May 2023 23:34:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/32676 )
Change subject: vty: make legacy 'hnbgw'/'sccp cr max...' fatal
......................................................................
vty: make legacy 'hnbgw'/'sccp cr max...' fatal
Make this deprecated command fatal when in a .cfg file:
hnbgw
sccp cr max-payload-len N
Because we now have:
cs7 instance N
sccp max-optional-data N
from libosmo-sigtran to replace it.
Context: The old command currently has no effect, because we had
implemented the specified fixed 130 byte data limit in libosmo-sigtran.
Recent libosmo-sigtran adds a variable limit configuration.
I considered implementing a shim to redirect the legacy command to the
new implementation, but that would be quite ugly: the old command is
under the 'hnbgw' node and would have to apply to all 'cs7' instances.
But we cannot assume that all 'cs7' are above or below the 'hnbgw' node
in the .cfg file. So I'd have to add global state to remember the legacy
config's value and apply that everywhere else. IMHO this is too much
complexity to support an obsoleted command that has a replacement.
To rule out all confusion that this situation may otherwise create,
abort osmo-hnbgw startup in presence of the legacy VTY command, logging
an error that hints at the new cfg item.
Related: SYS#6423
Change-Id: I71f82efe07af2c32f2aa01084bc8da6ce5c6cd1a
---
M TODO-RELEASE
M src/osmo-hnbgw/hnbgw_vty.c
2 files changed, 45 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/76/32676/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index cf72895..ae5d20f 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -11,3 +11,4 @@
libosmo-sigtran >=1.7.0 Ensure SCCP CR max payload length of 130 bytes is enforced.
Uses osmo_scu_prim_hdr_name_c()
libosmo-mgcp-client > 1.11.0 mgcp_client_pool_empty()
+libosmo-sigtran >1.7.0 Require presence of vty 'cs7 instance'/'sccp max-optional-data' that the deprecated+fatal 'hnbgw'/'sccp cr...' tells the user to use instead.
diff --git a/src/osmo-hnbgw/hnbgw_vty.c b/src/osmo-hnbgw/hnbgw_vty.c
index 216d8cc..93eca41 100644
--- a/src/osmo-hnbgw/hnbgw_vty.c
+++ b/src/osmo-hnbgw/hnbgw_vty.c
@@ -340,10 +340,12 @@
" longer has any effect.\n"
"ignored\n")
{
- vty_out(vty, "%% deprecated, ignored: remove this from your config file: 'sccp cr max-payload-len N'%s",
- VTY_NEWLINE);
- /* Still return success to not break osmo-hnbgw startup for users with old config files. */
- return CMD_SUCCESS;
+ const char *errmsg = "'hnbgw' / 'sccp cr max-payload-len': deprecated, ignored." \
+ " Instead, use 'cs7 instance N' / 'sccp max-optional-data N' (libosmo-sigtran >1.7.0)";
+ vty_out(vty, "%% %s%s", errmsg, VTY_NEWLINE);
+ LOGP(DLGLOBAL, LOGL_ERROR, "VTY cfg: %s\n", errmsg);
+ /* Users should not be mislead into thinking that this config still works. Abort (when reading .cfg file). */
+ return CMD_WARNING;
}
DEFUN(cfg_hnbgw_iucs_remote_addr,
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/32676
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I71f82efe07af2c32f2aa01084bc8da6ce5c6cd1a
Gerrit-Change-Number: 32676
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria, pespin, daniel.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/32181 )
Change subject: tests: Add initial osmo_io tests
......................................................................
Patch Set 13: Code-Review+1
(2 comments)
File tests/osmo_io/osmo_io_test.c:
https://gerrit.osmocom.org/c/libosmocore/+/32181/comment/46d61c5c_720ce9a2
PS3, Line 54: printf("%s: Write returned rc=%d\n", osmo_iofd_get_name(iofd), rc);
> Correct. […]
yes, passing the msg to the write_cb is the right thing to do. Not sure whether 'const' is a good idea. After all, the call-back could also free a 'const' msgb and it would be just as much as an error. Also, it is perfectly legal for the call-back to modify the msgb at that point (for example to zero some kind of "secret" value (password, crypto key or whatever) which they don't want to retain in memory even of something that's returned to the talloc pool automatically a few nanoseconds later.
File tests/osmo_io/osmo_io_test.c:
https://gerrit.osmocom.org/c/libosmocore/+/32181/comment/9b2ad388_4f6f3dc8
PS9, Line 95: for (int i = 0; i < 128; i++)
> I would like to keep those as is tbh. […]
Ack
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/32181
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia67629e53f4d2e5784177250d58e268fdfcaa0c2
Gerrit-Change-Number: 32181
Gerrit-PatchSet: 13
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 09 May 2023 23:24:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment