aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-23 12:21:43 +0100
committerlaforge <laforge@osmocom.org>2024-03-02 09:18:00 +0000
commit313f5280270a0a03a6fe80470b3b60bbc9002f66 (patch)
tree897d2777b5df4f181037e0d9b5a10a09ce38b4a7
parentd467b6348cacfab8e3103362f583294531245563 (diff)
osmo_io: make use of osmo_iofd_get_ioops()
This avoids resetting the callbacks with the wrong ones in the SCTP case. Change-Id: Id3cb11bc0000299faa79d980de8abc1980916d70
-rw-r--r--TODO-RELEASE1
-rw-r--r--src/stream_cli.c5
-rw-r--r--src/stream_srv.c5
3 files changed, 3 insertions, 8 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 1d860cb..6642459 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -10,5 +10,6 @@
libosmocore >1.9.0 working osmo_sock_init2_multiaddr2() without setting flag OSMO_SOCK_F_BIND
libosmocore >1.9.0 use osmo_sock_multiaddr_get_name_buf()
libosmocore >1.9.0 use OSMO_IO_FD_MODE_RECVMSG_SENDMSG
+libosmocore >1.9.0 use osmo_iofd_get_ioops()
libosmo-netif added osmo_stream_srv_get_sockname()
libosmo-netif update-dependency libosmocore > 1.9.0 required for I89eb519b22d21011d61a7855b2364bc3c295df82
diff --git a/src/stream_cli.c b/src/stream_cli.c
index b664117..eef442c 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -629,10 +629,7 @@ static void configure_cli_segmentation_cb(struct osmo_stream_cli *cli,
{
/* Copy default settings */
struct osmo_io_ops client_ops;
- if (cli->proto == IPPROTO_SCTP)
- client_ops = osmo_stream_cli_ioops_sctp;
- else
- client_ops = osmo_stream_cli_ioops;
+ osmo_iofd_get_ioops(cli->iofd, &client_ops);
/* Set segmentation cb for this client */
client_ops.segmentation_cb = segmentation_cb;
osmo_iofd_set_ioops(cli->iofd, &client_ops);
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 70ebef8..33494fa 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -886,10 +886,7 @@ void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn,
OSMO_ASSERT(conn->mode == OSMO_STREAM_MODE_OSMO_IO);
/* Copy default settings */
struct osmo_io_ops conn_ops;
- if (conn->srv->proto == IPPROTO_SCTP)
- conn_ops = srv_ioops_sctp;
- else
- conn_ops = srv_ioops;
+ osmo_iofd_get_ioops(conn->iofd, &conn_ops);
/* Set segmentation cb for this connection */
conn_ops.segmentation_cb = segmentation_cb;
osmo_iofd_set_ioops(conn->iofd, &conn_ops);