pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34078 )
Change subject: stream_srv: Handle ESHUTDOWN and other write() errors destroying the socket
......................................................................
stream_srv: Handle ESHUTDOWN and other write() errors destroying the socket
If internal send() fails with a fatal error, it should destroy the
socket. The user will know about the event through the close_cb() called
during osmo_stream_srv_destroy().
As a result, the socket is not closed when receiving SHUTDOWN by the
peer (through SCTP MSG_NOTIFICATION), but keep it alive since the socket
can still keep receiving data from the peer. Only fail if write() to
that read-only socket is attempted.
Change-Id: I84ddebabdffe47733cb529bcfebec8757e6a172b
---
M src/stream_srv.c
1 file changed, 33 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/78/34078/1
diff --git a/src/stream_srv.c b/src/stream_srv.c
index be43a80..554596d 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -588,8 +588,18 @@
return;
}
- if (ret == -1) /* send(): On error -1 is returned, and errno is set appropriately */
- LOGSSRV(conn, LOGL_ERROR, "error to send: %s\n", strerror(errno));
+ if (ret == -1) {/* send(): On error -1 is returned, and errno is set appropriately */
+ int err = errno;
+ LOGSSRV(conn, LOGL_ERROR, "error to send: %s\n", strerror(err));
+ if (err == EAGAIN) {
+ /* Re-add at the start of the queue to re-attempt: */
+ llist_add(&msg->list, &conn->tx_queue);
+ return;
+ }
+ msgb_free(msg);
+ osmo_stream_srv_destroy(conn);
+ return;
+ }
msgb_free(msg);
@@ -877,8 +887,9 @@
break;
case SCTP_SHUTDOWN_EVENT:
LOGP(DLINP, LOGL_DEBUG, "===> SHUTDOWN EVT\n");
- /* Handle this like a regular disconnect */
- return 0;
+ /* RFC6458 3.1.4: Any attempt to send more data will cause sendmsg()
+ * to return with an ESHUTDOWN error. */
+ break;
}
return -EAGAIN;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34078
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I84ddebabdffe47733cb529bcfebec8757e6a172b
Gerrit-Change-Number: 34078
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077 )
Change subject: SGSN_Tests: add missing RIM ROUTING ADDRESS field in request
......................................................................
SGSN_Tests: add missing RIM ROUTING ADDRESS field in request
When sending the RAN INFORMATION REQUEST on GTP-C, we do not add a RIM
ROUTING ADDRESS + RIM ROUTING ADDRESS DISCRIMINATOR field next to the
RAN TRANSPARENT CONTAINER. Those two fields are requred by the spec,
see also: 3gpp TS 29.060, section 7.5.14
Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c
Related: OS#6095
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 23 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/77/34077/1
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index ac25caa..4af44ee 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -3478,6 +3478,8 @@
var template (value) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr;
var template (value) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont;
var template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont;
+ var template (value) RIM_RoutingAddress gtpc_rim_ra;
+ var template (value) RIM_RoutingAddress_Discriminator gtpc_rim_ra_discr;
var template (value) Gtp1cUnitdata gtpc_pdu;
gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(gtp_ci);
@@ -3492,7 +3494,12 @@
gtpc_bssgp_cont := ts_GTPC_RAN_Information_Request(ts_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr),
ts_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr),
gtpc_rim_req_cont);
- gtpc_pdu := ts_GTPC_RANInfoRelay(peer, ts_RANTransparentContainer_RAN_INFO_REQ(gtpc_bssgp_cont));
+
+ /* Assemble RIM Routing Address (essentially a copy of the destination cell identifier)*/
+ gtpc_rim_ra := ts_RIM_RoutingAddress(enc_RIM_Routing_Address_GTPC(valueof(gtpc_dst_addr)));
+ gtpc_rim_ra_discr := ts_RIM_RoutingAddress_Discriminator(hex2bit(RIM_ADDR_GERAN_CELL_ID));
+ gtpc_pdu := ts_GTPC_RANInfoRelay(peer, ts_RANTransparentContainer_RAN_INFO_REQ(gtpc_bssgp_cont),
+ gtpc_rim_ra, gtpc_rim_ra_discr);
GTPC.send(gtpc_pdu);
var template RIM_Routing_Address bssgp_dst_addr, bssgp_src_addr;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c
Gerrit-Change-Number: 34077
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria, pespin.
Hello Jenkins Builder, laforge, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937
to look at the new patch set (#4).
Change subject: MME_Tests: add testcase TC_RIM_RAN_INF
......................................................................
MME_Tests: add testcase TC_RIM_RAN_INF
The proposed testcase models a full RIM RAN INFORMATION REQUEST that
originates at the eNB (S1AP), is forwarded by the MME towards GERAN
(GTP) and goes back towards the MME (GTP) and is eventually forwarded
by the MME back to the eNB (S1AP).
Related: OS#5760
Related: OS#5759
Change-Id: I22d5aaab64df2824099977fb574afb86a4b7e91f
---
M mme/MME_Tests.ttcn
1 file changed, 278 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/33937/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I22d5aaab64df2824099977fb574afb86a4b7e91f
Gerrit-Change-Number: 33937
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: fixeria, pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937 )
Change subject: MME_Tests: add testcase TC_RIM_RAN_INF
......................................................................
Patch Set 4:
(2 comments)
File mme/MME_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937/comment/f6dfb479_ce07…
PS3, Line 108: global_enb_id_len := 8
> no semicolon? (same below)
Done
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937/comment/7511515b_47ee…
PS3, Line 822: * does not add this information element. */
> it shall not be added to the S1AP MME Direct Information Transfer, see 3GPP TS 36.413 section 8.14. […]
Thanks, I remember this now.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33937
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I22d5aaab64df2824099977fb574afb86a4b7e91f
Gerrit-Change-Number: 33937
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 04 Aug 2023 15:27:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34076 )
Change subject: GTP_Templates: add function to encode RIM_Routing_Address_GTPC
......................................................................
GTP_Templates: add function to encode RIM_Routing_Address_GTPC
When forwarding RAN TRANSPARENT CONTAINERs containers on GTP-C, the
sender adds a RIM ROUTING ADDRESS and a RIM ROUTING ADDRESS
DISCRIMINATOR. The RIM ROUTING ADDRESS is represented as an
octet-string, so we need an encoder function for it.
Related: OS#6095
Change-Id: I45d1f5b019f3847fd611c38dc19d78d6fe027c5a
---
M library/GTP_Templates.ttcn
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/34076/1
diff --git a/library/GTP_Templates.ttcn b/library/GTP_Templates.ttcn
index adae38f..719eff6 100644
--- a/library/GTP_Templates.ttcn
+++ b/library/GTP_Templates.ttcn
@@ -1082,6 +1082,8 @@
number_of_SI_PSI := int2bit(si_psi_num, 7),
sI_PSI := si_psi
}
+ external function enc_RIM_Routing_Address_GTPC(in RIM_Routing_Address_GTPC ra) return octetstring
+ with { extension "prototype(convert) encode(RAW)" };
/* RAN_Information_Request */
template (value) RAN_Information_Request_RIM_Container_GTPC
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34076
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I45d1f5b019f3847fd611c38dc19d78d6fe027c5a
Gerrit-Change-Number: 34076
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34062 )
Change subject: BTS_Tests: fix comment
......................................................................
BTS_Tests: fix comment
The testcase is about PCH, not AGCH
Related: OS#5927
Change-Id: I5c2aa1aab261a0f4bfb24b4be7af29c1d814d37a
---
M bts/BTS_Tests.ttcn
1 file changed, 13 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 93b0ddf..c5cc9c7 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -5806,7 +5806,7 @@
}
}
-/* Send AGCH from PCU; check it appears on Um side */
+/* Send PCH from PCU; check it appears on Um side */
testcase TC_pcu_data_req_pch() runs on test_CT {
timer T := 3.0;
f_init_with_pcuif();
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34062
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I5c2aa1aab261a0f4bfb24b4be7af29c1d814d37a
Gerrit-Change-Number: 34062
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged