Attention is currently required from: laforge.
fixeria has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/libosmocore/+/38003?usp=email )
Change subject: Fix building in environments that define _GNU_SOURCE
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/38003?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I36cb3a5555cb35ddc44f06d447268bd9cc0ce9b4
Gerrit-Change-Number: 38003
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 03 Sep 2024 10:41:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: neels, pespin.
laforge has posted comments on this change by neels. ( https://gerrit.osmocom.org/c/libosmo-netif/+/37991?usp=email )
Change subject: coverity CID#322728
......................................................................
Patch Set 1:
(1 comment)
File src/stream.c:
https://gerrit.osmocom.org/c/libosmo-netif/+/37991/comment/44cafc61_5150c60… :
PS1, Line 282: ret = sctp_recvmsg(fd, msg->tail, msgb_tailroom(msg), NULL, NULL, &sinfo, &flags);
> I would assume that any such socket related call will not need zero-initialization of pure output ar […]
See https://gerrit.osmocom.org/c/libosmo-netif/+/38004/1 for fixing the actual logical error.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/37991?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ia4c6b7c6f16331932e3f584b800e86d422a4f019
Gerrit-Change-Number: 37991
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 03 Sep 2024 10:32:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge.
pespin has posted comments on this change by laforge. ( https://gerrit.osmocom.org/c/libosmocore/+/38003?usp=email )
Change subject: Fix building in environments that define _GNU_SOURCE
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/38003?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I36cb3a5555cb35ddc44f06d447268bd9cc0ce9b4
Gerrit-Change-Number: 38003
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 03 Sep 2024 10:31:59 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/38004?usp=email )
Change subject: src/stream.c: Use sctp_assoc_id 'canary' to detect misisng sinfo
......................................................................
src/stream.c: Use sctp_assoc_id 'canary' to detect misisng sinfo
sctp_rcvinfo() has a successful return path that does *not* fill
the caller-provided sinfo structure. This would be highly unexpected
as we cannot determine the stream_id and PPID then.
Our osmo_io code path already handles that situation correctly
by logging a related error message. The non-osmo-io path however
would silently hide that error.
See also: https://github.com/sctp/lksctp-tools/issues/37
Change-Id: Idf9c0fa4db65ab6ea34a9cb2011400aadf3dd54e
---
M src/stream.c
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/04/38004/1
diff --git a/src/stream.c b/src/stream.c
index f8cbed6..5033f4c 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -279,8 +279,14 @@
int flags = 0;
int ret;
+ /* Canary to detect if kernel returns sinfo; see https://github.com/sctp/lksctp-tools/issues/37 */
+ sinfo.sinfo_assoc_id = 0;
+
ret = sctp_recvmsg(fd, msg->tail, msgb_tailroom(msg), NULL, NULL, &sinfo, &flags);
- return stream_sctp_recvmsg_trailer(log_pfx, msg, ret, &sinfo, flags);
+ if (sinfo.sinfo_assoc_id)
+ return stream_sctp_recvmsg_trailer(log_pfx, msg, ret, &sinfo, flags);
+ else
+ return stream_sctp_recvmsg_trailer(log_pfx, msg, ret, NULL, flags);
}
/*! wrapper for osmo_io asynchronous recvmsg response */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/38004?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Idf9c0fa4db65ab6ea34a9cb2011400aadf3dd54e
Gerrit-Change-Number: 38004
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>