Projects
osmocom:master
libosmocore
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 385
View file
libosmocore.spec
Changed
@@ -14,13 +14,13 @@ Name: libosmocore Requires: osmocom-master -Version: 1.10.0.47.38eb4 +Version: 1.10.0.54.3536 Release: 0 Summary: The Open Source Mobile Communications Core Library License: GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later Group: Productivity/Telephony/Utilities Url: https://osmocom.org/projects/libosmocore/wiki/Libosmocore -Source: libosmocore_1.10.0.47.38eb4.tar.xz +Source: libosmocore_1.10.0.54.3536.tar.xz Source1: rpmlintrc BuildRequires: automake >= 1.6 BuildRequires: libtool >= 2
View file
commit_353638e2ff94b1ae4f46132b30edbacc99259852.txt
Added
View file
commit_38eb4281066b73440230423dfcc055e80ace1b28.txt
Deleted
View file
libosmocore_1.10.0.47.38eb4.dsc -> libosmocore_1.10.0.54.3536.dsc
Changed
@@ -2,7 +2,7 @@ Source: libosmocore Binary: libosmocore, libosmocodec4, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore22, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm20, libosmogsm-doc, libosmoisdn0, libosmoisdn-doc, libosmovty13, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmosim-doc, libosmousb0, libosmousb-doc, libosmocore-dev, libosmocore-utils, libosmocore-dbg Architecture: any all -Version: 1.10.0.47.38eb4 +Version: 1.10.0.54.3536 Maintainer: Osmocom team <openbsc@lists.osmocom.org> Homepage: https://projects.osmocom.org/projects/libosmocore Standards-Version: 3.9.8 @@ -35,8 +35,8 @@ libosmovty-doc deb doc optional arch=all libosmovty13 deb libs optional arch=any Checksums-Sha1: - bde58bf5898ba78cf4bd8c47638318337e2f77c6 1123248 libosmocore_1.10.0.47.38eb4.tar.xz + 5cab2071ca26eaa4f4b8fa635f959e9ce70a2226 1123280 libosmocore_1.10.0.54.3536.tar.xz Checksums-Sha256: - dbe27783b3276ff80f41b07cbc1bc2bec1118e9e8d12a9a011bdf6735b7defd5 1123248 libosmocore_1.10.0.47.38eb4.tar.xz + 0c2f6e80fd73323cce398213b3b26f671c73bb81ffab7c9c3407a5f83f34fb2c 1123280 libosmocore_1.10.0.54.3536.tar.xz Files: - f19cad99e358b1081c724cd11fd20190 1123248 libosmocore_1.10.0.47.38eb4.tar.xz + fe38ed0c31a9136b4b100409efa6dcaa 1123280 libosmocore_1.10.0.54.3536.tar.xz
View file
libosmocore_1.10.0.47.38eb4.tar.xz/.tarball-version -> libosmocore_1.10.0.54.3536.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -1.10.0.47-38eb4 +1.10.0.54-3536
View file
libosmocore_1.10.0.47.38eb4.tar.xz/debian/changelog -> libosmocore_1.10.0.54.3536.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -libosmocore (1.10.0.47.38eb4) unstable; urgency=medium +libosmocore (1.10.0.54.3536) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom master feed - -- Osmocom OBS scripts <info@osmocom.org> Thu, 05 Dec 2024 13:52:26 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Tue, 10 Dec 2024 11:27:44 +0000 libosmocore (1.10.0) unstable; urgency=medium
View file
libosmocore_1.10.0.47.38eb4.tar.xz/src/core/osmo_io.c -> libosmocore_1.10.0.54.3536.tar.xz/src/core/osmo_io.c
Changed
@@ -328,7 +328,7 @@ void iofd_handle_segmented_read(struct osmo_io_fd *iofd, struct msgb *msg, int rc) { int res; - struct msgb *pending = NULL; + struct msgb *pending; OSMO_ASSERT(iofd->mode == OSMO_IO_FD_MODE_READ_WRITE); @@ -338,9 +338,18 @@ } do { + pending = NULL; res = iofd_handle_segmentation(iofd, msg, &pending); - if (res != IOFD_SEG_ACT_DEFER || rc < 0) + if (res != IOFD_SEG_ACT_DEFER || rc < 0) { 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, + * so discard it: */ + if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) { + msgb_free(pending); + return; + } + } if (res == IOFD_SEG_ACT_HANDLE_MORE) msg = pending; } while (res == IOFD_SEG_ACT_HANDLE_MORE); @@ -736,19 +745,29 @@ { int rc = 0; - if (fd >= 0) - iofd->fd = fd; - else if (iofd->fd < 0) { + if (fd < 0 && iofd->fd < 0) { /* this might happen if both osmo_iofd_setup() and osmo_iofd_register() are called with -1 */ LOGPIO(iofd, LOGL_ERROR, "Cannot register io_fd using invalid fd == %d\n", iofd->fd); return -EBADF; } + if (fd < 0) + fd = iofd->fd; + else if (iofd->fd < 0) + iofd->fd = fd; + + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) { + /* If re-registering same fd, handle as NO-OP. + * New FD should go through unregister() first. */ + return iofd->fd == fd ? 0 : -ENOTSUP; + } rc = osmo_iofd_ops.register_fd(iofd); if (rc) return rc; IOFD_FLAG_UNSET(iofd, IOFD_FLAG_CLOSED); + IOFD_FLAG_SET(iofd, IOFD_FLAG_FD_REGISTERED); + if ((iofd->mode == OSMO_IO_FD_MODE_READ_WRITE && iofd->io_ops.read_cb) || (iofd->mode == OSMO_IO_FD_MODE_RECVFROM_SENDTO && iofd->io_ops.recvfrom_cb) || (iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG && iofd->io_ops.recvmsg_cb)) { @@ -771,7 +790,14 @@ */ int osmo_iofd_unregister(struct osmo_io_fd *iofd) { - return osmo_iofd_ops.unregister_fd(iofd); + int rc; + + if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) + return 0; + + rc = osmo_iofd_ops.unregister_fd(iofd); + IOFD_FLAG_UNSET(iofd, IOFD_FLAG_FD_REGISTERED); + return rc; } /*! Retrieve the number of messages pending in the transmit queue. @@ -844,6 +870,10 @@ iofd->pending = NULL; + osmo_iofd_ops.read_disable(iofd); + osmo_iofd_ops.write_disable(iofd); + osmo_iofd_unregister(iofd); + rc = osmo_iofd_ops.close(iofd); iofd->fd = -1; return rc;
View file
libosmocore_1.10.0.47.38eb4.tar.xz/src/core/osmo_io_poll.c -> libosmocore_1.10.0.54.3536.tar.xz/src/core/osmo_io_poll.c
Changed
@@ -128,32 +128,24 @@ struct osmo_fd *ofd = &iofd->u.poll.ofd; int rc; - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) - return 0; osmo_fd_setup(ofd, iofd->fd, 0, &iofd_poll_ofd_cb_dispatch, iofd, 0); + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) + osmo_fd_write_enable(&iofd->u.poll.ofd); + rc = osmo_fd_register(ofd); - if (!rc) - IOFD_FLAG_SET(iofd, IOFD_FLAG_FD_REGISTERED); return rc; } static int iofd_poll_unregister(struct osmo_io_fd *iofd) { struct osmo_fd *ofd = &iofd->u.poll.ofd; - - if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_FD_REGISTERED)) - return 0; osmo_fd_unregister(ofd); - IOFD_FLAG_UNSET(iofd, IOFD_FLAG_FD_REGISTERED); - return 0; } static int iofd_poll_close(struct osmo_io_fd *iofd) { - iofd_poll_unregister(iofd); osmo_fd_close(&iofd->u.poll.ofd); - return 0; } @@ -179,11 +171,9 @@ static void iofd_poll_notify_connected(struct osmo_io_fd *iofd) { - int rc; + /* Set flag to enable during register() time: */ + IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - rc = iofd_poll_register(iofd); - if (rc < 0) - return; osmo_fd_write_enable(&iofd->u.poll.ofd); }
View file
libosmocore_1.10.0.47.38eb4.tar.xz/src/core/osmo_io_uring.c -> libosmocore_1.10.0.54.3536.tar.xz/src/core/osmo_io_uring.c
Changed
@@ -324,8 +324,65 @@ static void iofd_uring_write_enable(struct osmo_io_fd *iofd); static void iofd_uring_read_enable(struct osmo_io_fd *iofd); + +/* called via osmocom poll/select main handling once outbound non-blocking connect() completes */ +static int iofd_uring_connected_cb(struct osmo_fd *ofd, unsigned int what) +{ + struct osmo_io_fd *iofd = ofd->data; + + LOGPIO(iofd, LOGL_DEBUG, "Socket connected or failed.\n"); + + if (!(what & OSMO_FD_WRITE)) + return 0; + + /* Unregister from poll/select handling. */ + osmo_fd_unregister(ofd); + IOFD_FLAG_UNSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); + + /* Notify the application about this via a zero-length write completion call-back. */ + IOFD_FLAG_SET(iofd, IOFD_FLAG_IN_CALLBACK); + switch (iofd->mode) { + case OSMO_IO_FD_MODE_READ_WRITE: + iofd->io_ops.write_cb(iofd, 0, NULL); + break; + case OSMO_IO_FD_MODE_RECVFROM_SENDTO: + iofd->io_ops.sendto_cb(iofd, 0, NULL, NULL); + break; + case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + iofd->io_ops.sendmsg_cb(iofd, 0, NULL); + break; + } + IOFD_FLAG_UNSET(iofd, IOFD_FLAG_IN_CALLBACK); + + /* If write/read notifications are pending, enable it now. */ + if (iofd->u.uring.write_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + iofd_uring_write_enable(iofd); + if (iofd->u.uring.read_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + iofd_uring_read_enable(iofd); + + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read_msghdr && !iofd->u.uring.write_msghdr) + talloc_free(iofd); + return 0; +} + static int iofd_uring_register(struct osmo_io_fd *iofd) { + if (iofd->mode != OSMO_IO_FD_MODE_RECVMSG_SENDMSG) + return 0; /* Nothing to be done */ + + /* OSMO_IO_FD_MODE_RECVMSG_SENDMSG: + * Use a temporary osmo_fd which we can use to notify us once the connection is established + * or failed (indicated by FD becoming writable). This is needed as (at least for SCTP sockets) + * one cannot submit a zero-length writev/sendmsg in order to get notification when the socekt + * is writable.*/ + if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) { + osmo_fd_setup(&iofd->u.uring.connect_ofd, iofd->fd, OSMO_FD_WRITE, + iofd_uring_connected_cb, iofd, 0); + if (osmo_fd_register(&iofd->u.uring.connect_ofd) < 0) { + LOGPIO(iofd, LOGL_ERROR, "Failed to register FD for connect event.\n"); + return -EBADFD; + } + } return 0; } @@ -450,72 +507,21 @@ static int iofd_uring_close(struct osmo_io_fd *iofd) { - iofd_uring_read_disable(iofd); - iofd_uring_write_disable(iofd); - iofd_uring_unregister(iofd); return close(iofd->fd); } -/* called via osmocom poll/select main handling once outbound non-blocking connect() completes */ -static int iofd_uring_connected_cb(struct osmo_fd *ofd, unsigned int what) +static void iofd_uring_notify_connected(struct osmo_io_fd *iofd) { - struct osmo_io_fd *iofd = ofd->data; - - LOGPIO(iofd, LOGL_DEBUG, "Socket connected or failed.\n"); - - if (!(what & OSMO_FD_WRITE)) - return 0; - - /* Unregister from poll/select handling. */ - osmo_fd_unregister(ofd); - IOFD_FLAG_UNSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - - /* Notify the application about this via a zero-length write completion call-back. */ - IOFD_FLAG_SET(iofd, IOFD_FLAG_IN_CALLBACK); - switch (iofd->mode) { - case OSMO_IO_FD_MODE_READ_WRITE: - iofd->io_ops.write_cb(iofd, 0, NULL); - break; - case OSMO_IO_FD_MODE_RECVFROM_SENDTO: - iofd->io_ops.sendto_cb(iofd, 0, NULL, NULL); - break; - case OSMO_IO_FD_MODE_RECVMSG_SENDMSG: - iofd->io_ops.sendmsg_cb(iofd, 0, NULL); - break; - } - IOFD_FLAG_UNSET(iofd, IOFD_FLAG_IN_CALLBACK); - - /* If write/read notifications are pending, enable it now. */ - if (iofd->u.uring.write_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) + if (iofd->mode != OSMO_IO_FD_MODE_RECVMSG_SENDMSG) { iofd_uring_write_enable(iofd); - if (iofd->u.uring.read_enabled && !IOFD_FLAG_ISSET(iofd, IOFD_FLAG_CLOSED)) - iofd_uring_read_enable(iofd); + return; + } - if (IOFD_FLAG_ISSET(iofd, IOFD_FLAG_TO_FREE) && !iofd->u.uring.read_msghdr && !iofd->u.uring.write_msghdr) - talloc_free(iofd); - return 0; -} + /* OSMO_IO_FD_MODE_RECVMSG_SENDMSG: Don't call this function after enabling read or write. */ + OSMO_ASSERT(!iofd->u.uring.write_enabled && !iofd->u.uring.read_enabled); -static void iofd_uring_notify_connected(struct osmo_io_fd *iofd) -{ - if (iofd->mode == OSMO_IO_FD_MODE_RECVMSG_SENDMSG) { - /* Don't call this function after enabling read or write. */ - OSMO_ASSERT(!iofd->u.uring.write_enabled && !iofd->u.uring.read_enabled); - - /* Use a temporary osmo_fd which we can use to notify us once the connection is established - * or failed (indicated by FD becoming writable). - * This is needed as (at least for SCTP sockets) one cannot submit a zero-length writev/sendmsg - * in order to get notification when the socekt is writable.*/ - if (!IOFD_FLAG_ISSET(iofd, IOFD_FLAG_NOTIFY_CONNECTED)) { - osmo_fd_setup(&iofd->u.uring.connect_ofd, iofd->fd, OSMO_FD_WRITE, - iofd_uring_connected_cb, iofd, 0); - if (osmo_fd_register(&iofd->u.uring.connect_ofd) < 0) - LOGPIO(iofd, LOGL_ERROR, "Failed to register FD for connect event.\n"); - else - IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); - } - } else - iofd_uring_write_enable(iofd); + /* Set flag to enable temporary osmo_fd during register() time: */ + IOFD_FLAG_SET(iofd, IOFD_FLAG_NOTIFY_CONNECTED); } const struct iofd_backend_ops iofd_uring_ops = {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.