laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/36077?usp=email )


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
Depends: libosmocore.git Change-Id I03398c811b9534f50c6644b21eea89a04be29fb0
---
M TODO-RELEASE
M src/stream_cli.c
M src/stream_srv.c
3 files changed, 16 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/77/36077/1

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 1800640..88a697d 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -631,10 +631,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);

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36077?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id3cb11bc0000299faa79d980de8abc1980916d70
Gerrit-Change-Number: 36077
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <lafo...@osmocom.org>
Gerrit-MessageType: newchange

Reply via email to