laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36077?usp=email )
(
4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: osmo_io: make use of osmo_iofd_get_ioops() ......................................................................
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 --- M TODO-RELEASE M src/stream_cli.c M src/stream_srv.c 3 files changed, 15 insertions(+), 8 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
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 @@ { /* 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 @@ 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);