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


Change subject: Do not reconnect when receiving SCTP notification
......................................................................

Do not reconnect when receiving SCTP notification

If a notification is detected by stream_sctp_recvmsg_trailer(), it
returns -EAGAIN. This is not an error that should cause the stream
client to trigger a reconnect. It must drop that message, as it is
done at the stream server.

In both cases the unhandled msg must be freed.

Change-Id: Ic588e6d8a3eecde701778f7d6ff5599ab81eff2b
---
M src/stream_cli.c
M src/stream_srv.c
2 files changed, 23 insertions(+), 1 deletion(-)



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

diff --git a/src/stream_cli.c b/src/stream_cli.c
index 11c88ae..aeac78e 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -497,6 +497,10 @@
        struct osmo_stream_cli *cli  = osmo_iofd_get_data(iofd);

        res = stream_iofd_sctp_recvmsg_trailer(iofd, msg, res, msgh);
+       if (res == -EAGAIN) {
+               msgb_free(msg);
+               return;
+       }

        switch (cli->state) {
        case STREAM_CLI_STATE_CONNECTING:
diff --git a/src/stream_srv.c b/src/stream_srv.c
index a02c1c2..994015b 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -658,8 +658,10 @@
        LOGSSRV(conn, LOGL_DEBUG, "message received (res=%d)\n", res);

        res = stream_iofd_sctp_recvmsg_trailer(iofd, msg, res, msgh);
-       if (res == -EAGAIN)
+       if (res == -EAGAIN) {
+               msgb_free(msg);
                return;
+       }

        if (OSMO_UNLIKELY(res <= 0)) {
                /* This connection is dead, destroy it. */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36568?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: Ic588e6d8a3eecde701778f7d6ff5599ab81eff2b
Gerrit-Change-Number: 36568
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andr...@eversberg.eu>
Gerrit-MessageType: newchange

Reply via email to