Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41710?usp=email )
Change subject: gsmtap_util: Avoid sink_fd leak gsmtap_source_add_sinki() called multiple times
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41710?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I7af5a6c7d64954ee2cc013711702b846dfaa02b1
Gerrit-Change-Number: 41710
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 13:39:09 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41709?usp=email )
Change subject: vty: assert in optional param followed by optional-multi-choice param: Fix [2/2]
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41709?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I4c184db53bec28ab42bcd45e033733d850eea5d2
Gerrit-Change-Number: 41709
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 13:38:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41708?usp=email )
Change subject: vty: assert in optional param followed by optional-multi-choice param: Reproduce [1/2]
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41708?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I6ad93a304ce498ba9d57fc7e2fd238e6c16e29e0
Gerrit-Change-Number: 41708
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 13:38:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41707?usp=email )
Change subject: gsmtap_util: Fix fds not closed in ofd_wq_mode=0
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41707?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I55fd51066d22261cf89fbf9501bec3af743a641d
Gerrit-Change-Number: 41707
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 18 Dec 2025 13:38:32 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41710?usp=email )
Change subject: gsmtap_util: Avoid sink_fd leak gsmtap_source_add_sinki() called multiple times
......................................................................
gsmtap_util: Avoid sink_fd leak gsmtap_source_add_sinki() called multiple times
gti->sink_fd could leak if gsmtap_source_add_sink() was called multiple
times.
Also if gsmtap_source_add_sink_fd() failed, rc != -1 was returned and
hence a close() on a wrong fd would be attempted.
This commit fixes both issues, making the whole sink_fd field much more
robust.
Change-Id: I7af5a6c7d64954ee2cc013711702b846dfaa02b1
(cherry picked from commit 85112c4911252412f0d127f01bde92794e232d00)
---
M src/core/gsmtap_util.c
1 file changed, 11 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/41710/1
diff --git a/src/core/gsmtap_util.c b/src/core/gsmtap_util.c
index 35bbf77..9b9c3b6 100644
--- a/src/core/gsmtap_util.c
+++ b/src/core/gsmtap_util.c
@@ -435,7 +435,7 @@
/*! Add a local sink to an existing GSMTAP source and return fd
* \param[in] gti existing GSMTAP source
- * \returns file descriptor of locally bound receive socket
+ * \returns file descriptor of locally bound receive socket; negative on error
*
* In case the GSMTAP socket is connected to a local destination
* IP/port, this function creates a corresponding receiving socket
@@ -450,7 +450,15 @@
*/
int gsmtap_source_add_sink(struct gsmtap_inst *gti)
{
- return gti->sink_fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd2(gti));
+ int rc;
+
+ if (gti->sink_fd >= 0)
+ return -EALREADY;
+
+ rc = gsmtap_source_add_sink_fd(gsmtap_inst_fd2(gti));
+ if (rc >= 0)
+ gti->sink_fd = rc;
+ return rc;
}
/* Registered in Osmo IO as a no-op to set the write callback. */
@@ -535,7 +543,7 @@
close(gti->wq.bfd.fd);
- if (gti->sink_fd != -1) {
+ if (gti->sink_fd >= 0) {
close(gti->sink_fd);
gti->sink_fd = -1;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41710?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I7af5a6c7d64954ee2cc013711702b846dfaa02b1
Gerrit-Change-Number: 41710
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41709?usp=email )
Change subject: vty: assert in optional param followed by optional-multi-choice param: Fix [2/2]
......................................................................
vty: assert in optional param followed by optional-multi-choice param: Fix [2/2]
in cmd_make_descr, cp during the asserting iteration looks like this:
(gdb) print cp
$18 = 0x555555c1939d ") [(one|two|three)"
As a result, first multiple is set to 0 and later on logic was missing
for this specific case.
Change-Id: I4c184db53bec28ab42bcd45e033733d850eea5d2
Fixes: b55f4d2df21b966c3953264d8961f259814f4650
Related: OS#6360
(cherry picked from commit 2e41c4301ece14cbd9d22896a079619ba080200a)
---
M src/vty/command.c
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/41709/1
diff --git a/src/vty/command.c b/src/vty/command.c
index 8594290..c1bda8a 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -443,6 +443,12 @@
while (isspace((int)*cp) && *cp != '\0')
cp++;
+ /* Explicitly detect optional multi-choice braces like [(one|two)]. */
+ if (cp[0] == '[' && cp[1] == '(') {
+ optional_brace = 1;
+ cp++;
+ }
+
if (*cp == '(') {
multiple = 1;
cp++;
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41709?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: pespin/rel-1.12.0
Gerrit-Change-Id: I4c184db53bec28ab42bcd45e033733d850eea5d2
Gerrit-Change-Number: 41709
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>