Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548 )
Change subject: hnb_read_cb: Store ofd in variable
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548/comment/e3d82cf2_257b5115
PS1, Line 7: hnb_read_cb: Store ofd in variable
"use local var to reduce get_ofd() calls"
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29548
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic7058b5a05b0d34b80617006d4e929a523212221
Gerrit-Change-Number: 29548
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 14:30:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/29549 )
Change subject: hnb_read_cb(): -EBADF must be returned if conn is freed to avoid use-after-free
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29549/comment/526a25ae_b3c2f706
PS1, Line 11: loop iteration.
sounds like adapting the api implementation to fix a problem that should be fixed in the calling code. Why is it not enough to return more detailed negative rc, especially in the case
} else if (rc < 0) {
...
Now the caller always gets -EBADF, hiding the actual error cause that was returned before.
"Bad file descriptor" seems inaccurate
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29549
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I628c59a88d94d299f432f405b37fbe602381d47e
Gerrit-Change-Number: 29549
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:27:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29540 )
Change subject: stream: Set proper msgb length when returning sctp_notification
......................................................................
Patch Set 1:
(2 comments)
Patchset:
PS1:
> IMHO we should directly set the msgb length in all cases where sctp_recvmsg() returned a length. […]
It's not returning user data, it's a really specific SCTP use case which we try to emulate through a generic API used by several protocols.
I'm fine with submitting a new patch documenting it.
File src/stream.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/29540/comment/d45cb613_b3fc71e2
PS1, Line 1563: msgb_put(msg, ret);
> i'd move this step to directly after sctp_recvmsg()
This is the generic and regular place where user data content is updated in the msgb, so it's fine here.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29540
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I95e2457498fd8e0d790d221cb97695ace0dd673e
Gerrit-Change-Number: 29540
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:22:30 +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/+/29540 )
Change subject: stream: Set proper msgb length when returning sctp_notification
......................................................................
Patch Set 1:
(2 comments)
Patchset:
PS1:
IMHO we should directly set the msgb length in all cases where sctp_recvmsg() returned a length.
Seems this is done in osmo_stream_srv_recv(), just not in cases where error is returned.
Doing the put() that late leaves the msgb in incomplete state, hoping that the returned value ends up being put() in the msgb later, which i believe is the root reason for the problem that this patch fixes
Also weird now is that an error is returned, but the msgb has actually received data in it.
This is highly unusual behavior of a function and must be api-documented IMO.
File src/stream.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/29540/comment/1947a7b5_18343cff
PS1, Line 1563: msgb_put(msg, ret);
i'd move this step to directly after sctp_recvmsg()
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29540
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I95e2457498fd8e0d790d221cb97695ace0dd673e
Gerrit-Change-Number: 29540
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:18:47 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: neels.
Hello Jenkins Builder, neels,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-netif/+/29545
to look at the new patch set (#2).
Change subject: stream: Return 0 when receiving sctp notification SCTP_COMM_LOST
......................................................................
stream: Return 0 when receiving sctp notification SCTP_COMM_LOST
It was seen on a real pcap trace (sctp & gsmtap_log) that the Linux
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 dead by returning 0,
to comply with usual recv() API.
Related: SYS#6113
Change-Id: If94d44f25b76a96a5ea402fec9fc14c4e6296ba3
---
M src/stream.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/45/29545/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29545
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: If94d44f25b76a96a5ea402fec9fc14c4e6296ba3
Gerrit-Change-Number: 29545
Gerrit-PatchSet: 2
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-MessageType: newpatchset
Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29545 )
Change subject: stream: Return 0 when receiving sctp notification SCTP_COMM_LOST
......................................................................
Patch Set 1:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/libosmo-netif/+/29545/comment/7feb023b_bef5e9ae
PS1, Line 9: kernel
> probably the *Linux* kernel stack?
I'm not aware that we officialy support any other kernel/OS so far.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29545
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: If94d44f25b76a96a5ea402fec9fc14c4e6296ba3
Gerrit-Change-Number: 29545
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:12:21 +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/+/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