Attention is currently required from: pespin.
osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/39361?usp=email )
Change subject: cosmetic: osmo_io: Improvde documentation of read_cb when segmentation is used
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39361?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: master
Gerrit-Change-Id: I93ac0b3224e17bfd1ecd4244a6dc7a44457c06e8
Gerrit-Change-Number: 39361
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 17 Jan 2025 10:12:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39363?usp=email )
Change subject: osmo_io: Support writing to files with mode OSMO_IO_FD_MODE_READ_WRITE
......................................................................
osmo_io: Support writing to files with mode OSMO_IO_FD_MODE_READ_WRITE
Trying to use IORING_OP_SENDMSG on local files fails with "Socket
operation on non-socket" errors.
Change-Id: Iefcbc7d09f429f4ecc611227cb5ef796f50c0539
---
M src/core/osmo_io_uring.c
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/63/39363/1
diff --git a/src/core/osmo_io_uring.c b/src/core/osmo_io_uring.c
index 72a465e..5fd7ddc 100644
--- a/src/core/osmo_io_uring.c
+++ b/src/core/osmo_io_uring.c
@@ -307,6 +307,8 @@
switch (msghdr->action) {
case IOFD_ACT_WRITE:
+ io_uring_prep_write(sqe, msghdr->iofd->fd, msghdr->iov[0].iov_base, msghdr->iov[0].iov_len, 0);
+ break;
case IOFD_ACT_SENDTO:
case IOFD_ACT_SENDMSG:
io_uring_prep_sendmsg(sqe, msghdr->iofd->fd, &msghdr->hdr, msghdr->flags);
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39363?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: master
Gerrit-Change-Id: Iefcbc7d09f429f4ecc611227cb5ef796f50c0539
Gerrit-Change-Number: 39363
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/39362?usp=email
to look at the new patch set (#2).
Change subject: hnbgw_rx_hnb_register_req(): guard against asn.1 parsing errors
......................................................................
hnbgw_rx_hnb_register_req(): guard against asn.1 parsing errors
I considered putting these checks into
hnbap_decode_hnbregisterrequesties() itself, but that code is generated
by asn1tostruct.py, so it is non-trivial.
So I decided to add this code bit, to guard against potential NULL deref
induced by input from the wire, which coverity complains about.
Related: CID#465551
Change-Id: I555f11cadc23ea231821bd48f7cd62953b022e9e
---
M src/osmo-hnbgw/hnbgw_hnbap.c
1 file changed, 17 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/62/39362/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/39362?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I555f11cadc23ea231821bd48f7cd62953b022e9e
Gerrit-Change-Number: 39362
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39360?usp=email )
Change subject: osmo_io: segmentation: Remove unneeded impossible check
......................................................................
osmo_io: segmentation: Remove unneeded impossible check
The rc <= 0 case is already early returned above.
Change-Id: I9316730aeaf7c7efd3ea8965ab43fa21f844260c
---
M src/core/osmo_io.c
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/60/39360/1
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 45aaef3..15703cf 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -343,7 +343,7 @@
do {
pending = NULL;
res = iofd_handle_segmentation(iofd, msg, &pending);
- if (res != IOFD_SEG_ACT_DEFER || rc < 0) {
+ if (res != IOFD_SEG_ACT_DEFER) {
iofd->io_ops.read_cb(iofd, rc, msg);
/* The user could unregister/close the iofd during read_cb() above.
* Once that's done, it doesn't expect to receive any more events,
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39360?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: master
Gerrit-Change-Id: I9316730aeaf7c7efd3ea8965ab43fa21f844260c
Gerrit-Change-Number: 39360
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/39361?usp=email )
Change subject: cosmetic: osmo_io: Improvde documentation of read_cb when segmentation is used
......................................................................
cosmetic: osmo_io: Improvde documentation of read_cb when segmentation is used
Change-Id: I93ac0b3224e17bfd1ecd4244a6dc7a44457c06e8
---
M include/osmocom/core/osmo_io.h
M src/core/osmo_io.c
2 files changed, 8 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/39361/1
diff --git a/include/osmocom/core/osmo_io.h b/include/osmocom/core/osmo_io.h
index fa1f9c3..f4bfec4 100644
--- a/include/osmocom/core/osmo_io.h
+++ b/include/osmocom/core/osmo_io.h
@@ -98,7 +98,11 @@
* \param[in] iofd osmo_io_fd for which read() has completed.
* \param[in] res return value of the read() call, or -errno in case of error.
* \param[in] msg message buffer containing the read data. Ownership is transferred to the
- * call-back, and it must make sure to msgb_free() it eventually! */
+ * call-back, and it must make sure to msgb_free() it eventually!
+ *
+ * NOTE: If segmentation_cb is in use, the bytes read in res value
+ * may be different than those provided in the msg parameter!
+ */
void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg);
/*! completion call-back function when write issued via osmo_iofd_write_msgb() has completed
diff --git a/src/core/osmo_io.c b/src/core/osmo_io.c
index 15703cf..65c9b33 100644
--- a/src/core/osmo_io.c
+++ b/src/core/osmo_io.c
@@ -344,6 +344,9 @@
pending = NULL;
res = iofd_handle_segmentation(iofd, msg, &pending);
if (res != IOFD_SEG_ACT_DEFER) {
+ /* It it expected as per API spec that we return the
+ * return value of read here. The amount of bytes in msg is
+ * available to the user in msg itself. */
iofd->io_ops.read_cb(iofd, rc, msg);
/* The user could unregister/close the iofd during read_cb() above.
* Once that's done, it doesn't expect to receive any more events,
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/39361?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: master
Gerrit-Change-Id: I93ac0b3224e17bfd1ecd4244a6dc7a44457c06e8
Gerrit-Change-Number: 39361
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>