Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29543 )
Change subject: stream: Set sctp_ppid and sctp_stream when sctp notifciation is received
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> would be good to read context in the commit log, whether it fixes a bug / motivation for the patch e […]
Same rationale as previous patch discussion. When receiving notifications, the user may as well get that information. Any out params should be initialized to some expected value, specially if they can be used by the caller.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29543
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I99f6098d8d9fc1c06bc28373bf7ee76f15d5f525
Gerrit-Change-Number: 29543
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 30 Sep 2022 14:11:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29541 )
Change subject: stream: Erase sctp_msg_flags if receiving user data
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
> i'd like to know more: what flags are set previously? […]
Flags are set by the API, so regardless of the app resetting them or not, it's the API duty to set them to whatever value is expected (be it a specific flag or 0 aka no flags).
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29541
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id358140db82b018e3973111e530834589c0b7224
Gerrit-Change-Number: 29541
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 30 Sep 2022 14:10:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29541 )
Change subject: stream: Erase sctp_msg_flags if receiving user data
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
i'd like to know more: what flags are set previously?
shouldn't the user (calling code) make sure that the flags are cleared when reusing the msgb?
what do you mean by reusing -- a msgb by definition gets reused by all layers?
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29541
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Id358140db82b018e3973111e530834589c0b7224
Gerrit-Change-Number: 29541
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 30 Sep 2022 14:05:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29543 )
Change subject: stream: Set sctp_ppid and sctp_stream when sctp notifciation is received
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Patchset:
PS1:
would be good to read context in the commit log, whether it fixes a bug / motivation for the patch etc
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29543
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I99f6098d8d9fc1c06bc28373bf7ee76f15d5f525
Gerrit-Change-Number: 29543
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 30 Sep 2022 13:59:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29547 )
Change subject: Close conn when receiving SCTP_ASSOC_CHANGE notification
......................................................................
Close conn when receiving SCTP_ASSOC_CHANGE notification
It was seen on a real pcap trace (sctp & gsmtap_log) that the kernel
stack may decide to kill the connection (sending an ABORT) if it fails
to transmit some data after a while:
ABORT Cause code: "Protocol violation (0x000d)",
Cause Information: "Association exceeded its max_retrans count".
When this occurs, the kernel sends the
MSG_NOTIFICATION,SCTP_ASSOC_CHANGE,SCTP_COMM_LOST notification when
reading from the socket with sctp_recvmsg(). This basically signals that
the socket conn is death, and subsequent writes to it will result in
send() failures (and receive SCTP_SEND_FAILED notification upon follow
up reads).
It's important to notice that after those events, there's no other sort
of different event like SHUTDOWN coming in, so that's the time at which
we must tell the user to close the socket.
Hence, let's signal the caller that the socket is death by returning 0,
to comply with usual recv() API.
Related: SYS#6113
Change-Id: If35efd404405f926a4a6cc45862eeadd1b04e08c
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/47/29547/1
diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index 0c59c7d..dd0999c 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -258,6 +258,13 @@
switch (notif->sn_header.sn_type) {
case SCTP_ASSOC_CHANGE:
switch (notif->sn_assoc_change.sac_state) {
+ case SCTP_COMM_LOST:
+ LOGHNB(hnb, DMAIN, LOGL_NOTICE,
+ "sctp_recvmsg(%s) = SCTP_COMM_LOST, closing conn\n",
+ osmo_sock_get_name2(osmo_stream_srv_get_ofd(conn)->fd));
+ osmo_stream_srv_destroy(conn);
+ rc = -1;
+ break;
case SCTP_RESTART:
LOGHNB(hnb, DMAIN, LOGL_NOTICE, "HNB SCTP conn RESTARTed, marking as HNBAP-unregistered\n");
hnb->hnb_registered = false;
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29547
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: If35efd404405f926a4a6cc45862eeadd1b04e08c
Gerrit-Change-Number: 29547
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange