Attention is currently required from: arehbein, fixeria, laforge, neels, pespin.
Hello Jenkins Builder, fixeria, laforge, neels, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/31878?usp=email
to look at the new patch set (#17).
The following approvals got outdated and were removed:
Code-Review-1 by pespin, Verified+1 by Jenkins Builder
Change subject: Introduce per-BTS timers, RLC timer commands
......................................................................
Introduce per-BTS timers, RLC timer commands
- Add per-BTS timer groups ('rlc' only for now, others to follow)
- Add vty commands & tests for those timers
Related: OS#5335
Change-Id: I2c24110d8c977d6cc74c3c8e77bcc709ad9d2675
---
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/gsm_data.h
M include/osmocom/bsc/vty.h
M src/osmo-bsc/bsc_init.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_init.c
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/pcu_sock.c
M tests/bts_features.vty
M tests/nanobts_omlattr/nanobts_omlattr_test.c
12 files changed, 477 insertions(+), 65 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/78/31878/17
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31878?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I2c24110d8c977d6cc74c3c8e77bcc709ad9d2675
Gerrit-Change-Number: 31878
Gerrit-PatchSet: 17
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: arehbein.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/31880?usp=email
to look at the new patch set (#7).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: Make NSE timing data configurable
......................................................................
Make NSE timing data configurable
Also: Deprecate/hide old respective VTY command,
while preserving backwards compatibility
for NSE timing data configuration.
Related: OS#5335
Change-Id: Ie46ec5cb7095bc1dfe3effd0e76d6ccfd6bd2f3f
---
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/bts_sm.h
M include/osmocom/bsc/vty.h
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts_init.c
M src/osmo-bsc/bts_ipaccess_nanobts_omlattr.c
M src/osmo-bsc/bts_sm.c
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/pcu_sock.c
M tests/bts_features.vty
M tests/gprs_params.vty
M tests/nanobts_omlattr/nanobts_omlattr_test.c
12 files changed, 165 insertions(+), 59 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/80/31880/7
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/31880?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie46ec5cb7095bc1dfe3effd0e76d6ccfd6bd2f3f
Gerrit-Change-Number: 31880
Gerrit-PatchSet: 7
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, osmith.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35207?usp=email )
Change subject: util: add osmo_strbuf macros to manipulate the strbuf tail
......................................................................
Patch Set 1:
(1 comment)
File include/osmocom/core/utils.h:
https://gerrit.osmocom.org/c/libosmocore/+/35207/comment/64c3fd64_a479c3a0
PS1, Line 329: } while (0)
> I agree. […]
yeah, it's becoming a habit. it is a form of inlining code but .. nevermind, ack
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/35207?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I997707c328eab3ffa00a78fdb9a0a2cbe18404b4
Gerrit-Change-Number: 35207
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Tue, 05 Dec 2023 05:04:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35205?usp=email )
Change subject: IuUP: allow Initialization from any address if not yet set
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File src/libosmo-mgcp/mgcp_network.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/35205/comment/0fd6cabe_ade0e27e
PS1, Line 843: return 0;
> we should only avoid the check if the conn addr is not set (see "osmo_sockaddr_is_any(&conn->end. […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35205?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6c365559a7bd197349f0ea99f7a13b56a4bb580b
Gerrit-Change-Number: 35205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 04 Dec 2023 23:49:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35176?usp=email )
Change subject: IuUP: Allow Initialization with set rem IP address and unset rem port
......................................................................
Patch Set 4:
(3 comments)
Commit Message:
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/4827b0ff_d321205f
PS2, Line 7: mgcp_network: Allow rx of IuUP in loopback mode with set rem IP address and unset rem port
> (you're getting into a habit of too long summary lines)
Done
Commit Message:
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/f1acf2a3_524febff
PS4, Line 7: rem
(i'd rather write out "remote" and abbreviate "Init" and "addr")
File src/libosmo-mgcp/mgcp_network.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/22d2e586_68b0321b
PS2, Line 866: HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP
: * messag
> Tests show these things: […]
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35176?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Idd833997abce46886e9664505b2776fa5dadc8db
Gerrit-Change-Number: 35176
Gerrit-PatchSet: 4
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: Mon, 04 Dec 2023 23:47:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35205?usp=email )
Change subject: IuUP: allow Initialization from any address if not yet set
......................................................................
Patch Set 2:
(4 comments)
Commit Message:
https://gerrit.osmocom.org/c/osmo-mgw/+/35205/comment/b8d972c3_5d581f06
PS1, Line 28: Decided for now that it's not worth the extra effort to make this more
: restrictive
> I would beg to differ. […]
ok, I understand. I thought the paradigm would be to allow any path for the UDP of RTP, but you are instead stressing the need to validate the sender for RTP.
One last spark of doubt: we do allow any source address to send MGCP to the MGW and actually create and destroy entire endpoints, so it seems a bit silly to restrict RTP? Is it because MGCP to MGW is lateral / easy to restrict locally, while RTP travels up/down "the stack"?
Patchset:
PS2:
got me confused at first by uploading a new version of my patch...
File src/libosmo-mgcp/mgcp_network.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/35205/comment/8befca28_81155a88
PS1, Line 838: if (mgcp_conn_rtp_is_iuup(conn) && !conn->iuup.configured) {
> I see a problem with this, regarding SYS#6657. […]
(There are two places to indicate codecs, one in the MGCP header which we basically ignore, and the SDP payload.)
In my tests, both osmo-msc and osmo-hnbgw indicate IUFP in the very first CRCX they send out. That is done in the *MGCP* header's 'L:' line, *without* SDP. That is how osmo-mgw can put the conn in IUFP mode right from the start. See for example https://people.osmocom.org/neels/Iere6lei/3g3g.pcapng
It is actually a bit more complex in osmo-hnbgw:
osmo-hnbgw sends an 'L: ... a:VNG.3GPP.IUFP' in the first CRCX;
but for the endpoint's other conn, the second CRCX, there is no 'L:' header and the contained SDP indicates IUFP.
So AFAICT indicating IUFP already happens with nightly osmo-cni, right from the first CRCX, and does not require an IP address.
(Not so sure about latest or whatever the issue reporter has)
Which means we can safely check for conn->type == IUFP here.
Right?
File src/libosmo-mgcp/mgcp_network.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/35205/comment/5ef3644d_2f2de566
PS2, Line 837: != 0)
(i find this really hard to read. the function returns essentially a bool, so i'd much rather just read 'if (osmo_sockaddr_is_any(..))' here. Seeing the "!= 0" makes me think that 0 might be the success-rc and we check for NOT any instead.)
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35205?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I6c365559a7bd197349f0ea99f7a13b56a4bb580b
Gerrit-Change-Number: 35205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 04 Dec 2023 23:43:06 +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>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/35176?usp=email )
Change subject: IuUP: Allow Initialization with set rem IP address and unset rem port
......................................................................
Patch Set 4: Code-Review+1
(5 comments)
Patchset:
PS4:
Ok, I see, and agree with this.
Below some petty details below.
First petty detail: we could squash it into that other patch.
File src/libosmo-mgcp/mgcp_network.c:
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/e0c4ce52_25437aa2
PS4, Line 838: osmo_sockaddr_port(&conn->end.addr.u.sa) == 0) {
the most concise restriction would be:
- validate the IP address if present,
- and validate the port if present, independently.
I mean, in this patch we skip both checks if one of them is not set. Instead we can skip only the port number check if port == 0, and skip only the address check if address == ANY.
(That's mainly why it's so compelling to just skip sender validation for early IuUP entirely; doing checks properly rejiggers this entire function.)
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/6ec9f8d2_73ec40b1
PS4, Line 841: announce
"not all hNodeB", but some are happily sending RAB Assignment success before IuUP Initialization.
I find "MGCP client" confusing here, the hNodeB obviously does not talk MGCP protocol.
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/a34c5956_389c6fc8
PS4, Line 842: ASs
(RAB Assignment Response at HNBGW)
https://gerrit.osmocom.org/c/osmo-mgw/+/35176/comment/f783b56a_3eb116ae
PS4, Line 843: MDCX
Writing "MDCX" is too specific: it is up to the client to do CRCX with SDP all-in-one or adjust with MDCX later.
I'd rather write:
Hence the MGW may not yet know the remote IuUP address and port at the time of receiving IuUP Initialization from the hNodeB.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/35176?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Idd833997abce46886e9664505b2776fa5dadc8db
Gerrit-Change-Number: 35176
Gerrit-PatchSet: 4
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: Mon, 04 Dec 2023 23:41:07 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35215?usp=email )
Change subject: perform multiple GET RESPONSE cycles if more data is available
......................................................................
perform multiple GET RESPONSE cycles if more data is available
So far we implemented only one round of "Send the APDU, get SW=61xx,
call GET RESPONSE". This permitted us to receive only data up to 256
bytes.
Let's extend that to doing multiple rounds, concatenating the result.
This allows us to obtain arbitrary-length data from the card.
See Annex C.1 of ETSI TS 102 221 for examples showing multiple 61xx
iterations.
Change-Id: Ib17da655aa0b0eb203c29dc92690c81bd1300778
Closes: OS#6287
---
M pySim/transport/__init__.py
1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/15/35215/1
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index e90ced6..2ffb9c3 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -137,11 +137,12 @@
# xx is the number of response bytes available.
# See also:
if (sw is not None):
- if ((sw[0:2] == '9f') or (sw[0:2] == '61')):
+ while ((sw[0:2] == '9f') or (sw[0:2] == '61')):
# SW1=9F: 3GPP TS 51.011 9.4.1, Responses to commands which are correctly executed
# SW1=61: ISO/IEC 7816-4, Table 5 — General meaning of the interindustry values of SW1-SW2
pdu_gr = pdu[0:2] + 'c00000' + sw[2:4]
- data, sw = self.send_apdu_raw(pdu_gr)
+ d, sw = self.send_apdu_raw(pdu_gr)
+ data += d
if sw[0:2] == '6c':
# SW1=6C: ETSI TS 102 221 Table 7.1: Procedure byte coding
pdu_gr = pdu[0:8] + sw[2:4]
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35215?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib17da655aa0b0eb203c29dc92690c81bd1300778
Gerrit-Change-Number: 35215
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/35168?usp=email )
Change subject: mgw_fsm: Modify RAB on HNB if IuUP local IP addr at MGW changes during MDCX
......................................................................
mgw_fsm: Modify RAB on HNB if IuUP local IP addr at MGW changes during MDCX
Allow IP address renegotation between HNB and MGW:
* Upon MGCP MDCX ACK received from the RAN-side conn, if the IP address/port
changes, then restart the RAB-Ass-Req+Resp procedure on Iuh.
* Upon RAB-Ass-Resp received from the HNB, if the IP address/port changes,
then go through another MDCX + MDCX ACK prcoedure on MGCP.
An MDCX counter is introduced to avoid infinite loops where the HNB and
the MGW keep changing their IP address triggered by the change on the
other side, eg. due to incorrect network/routing setup.
The counter is also used to track count in order to make sure that
always at least 1 MDCX is transmitted, in order to change conn_mode to
SEND_RECV.
Related: OS#6127
Change-Id: I936a50fed38a201c4a8da99b40f07082049e5157
---
M src/osmo-hnbgw/mgw_fsm.c
1 file changed, 113 insertions(+), 62 deletions(-)
Approvals:
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/osmo-hnbgw/mgw_fsm.c b/src/osmo-hnbgw/mgw_fsm.c
index e1e53fb..d762d11 100644
--- a/src/osmo-hnbgw/mgw_fsm.c
+++ b/src/osmo-hnbgw/mgw_fsm.c
@@ -109,6 +109,11 @@
ranap_message *ranap_rab_ass_req_message;
ranap_message *ranap_rab_ass_resp_message;
struct msgb *ranap_rab_ass_resp_msgb;
+ /* IP address contained in ranap_rab_ass_resp_msgb/message: */
+ struct osmo_sockaddr hnb_rtp_addr;
+ /* Number of MDCX transmitted. Used to detect current mgw conn_mode and
+ * detect modify infinite loops: */
+ unsigned int mdcx_tx_cnt;
/* MGW context */
struct mgcp_client *mgcpc;
@@ -205,8 +210,6 @@
struct mgw_fsm_priv *mgw_fsm_priv = fi->priv;
const struct mgcp_conn_peer *mgw_info;
struct osmo_sockaddr_str addr_str;
- struct osmo_sockaddr *addr = &mgw_fsm_priv->ci_hnb_crcx_ack_addr;
- RANAP_RAB_AssignmentRequestIEs_t *ies;
int rc;
switch (event) {
@@ -224,7 +227,7 @@
addr_str.af = AF_INET6;
addr_str.port = mgw_info->port;
osmo_strlcpy(addr_str.ip, mgw_info->addr, sizeof(addr_str.ip));
- rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &addr->u.sas);
+ rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &mgw_fsm_priv->ci_hnb_crcx_ack_addr.u.sas);
if (rc < 0) {
LOGPFSML(fi, LOGL_ERROR,
"Failed to convert RTP IP-address (%s) and Port (%u) to its binary representation\n",
@@ -233,16 +236,6 @@
return;
}
- ies = &mgw_fsm_priv->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs;
- rc = ranap_rab_ass_req_ies_replace_inet_addr(ies, addr, mgw_fsm_priv->rab_id);
- if (rc < 0) {
- LOGPFSML(fi, LOGL_ERROR,
- "Failed to replace RTP IP-address (%s) and Port (%u) in RAB-AssignmentRequest\n",
- mgw_info->addr, mgw_info->port);
- osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
- return;
- }
-
mgw_fsm_state_chg(fi, MGW_ST_ASSIGN);
return;
default:
@@ -256,8 +249,16 @@
struct hnbgw_context_map *map = mgw_fsm_priv->map;
RANAP_RAB_AssignmentRequestIEs_t *ies;
struct msgb *msg;
+ int rc;
ies = &mgw_fsm_priv->ranap_rab_ass_req_message->msg.raB_AssignmentRequestIEs;
+ rc = ranap_rab_ass_req_ies_replace_inet_addr(ies, &mgw_fsm_priv->ci_hnb_crcx_ack_addr, mgw_fsm_priv->rab_id);
+ if (rc < 0) {
+ LOGPFSML(fi, LOGL_ERROR, "Failed to replace RTP IP-address and Port in RAB-AssignmentRequest\n");
+ osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
+ return;
+ }
+
msg = ranap_rab_ass_req_encode(ies);
if (!msg) {
LOGPFSML(fi, LOGL_ERROR, "failed to re-encode RAB-AssignmentRequest message\n");
@@ -273,9 +274,74 @@
static void mgw_fsm_assign(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
+ struct mgw_fsm_priv *mgw_fsm_priv = fi->priv;
+ struct hnbgw_context_map *map = mgw_fsm_priv->map;
+ RANAP_RAB_AssignmentResponseIEs_t *ies;
+ bool rab_failed_at_hnb;
+ struct osmo_sockaddr addr;
+ enum mgw_fsm_state next_st;
+ int rc;
+
switch (event) {
case MGW_EV_RAB_ASS_RESP:
- mgw_fsm_state_chg(fi, MGW_ST_MDCX_HNB);
+ LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received, completing HNB side call-leg on MGW...\n");
+ ies = &mgw_fsm_priv->ranap_rab_ass_resp_message->msg.raB_AssignmentResponseIEs;
+ rc = ranap_rab_ass_resp_ies_extract_inet_addr(&addr, ies, mgw_fsm_priv->rab_id);
+ if (rc < 0) {
+ rab_failed_at_hnb = ranap_rab_ass_resp_ies_check_failure(ies, mgw_fsm_priv->rab_id);
+ if (rab_failed_at_hnb) {
+ struct msgb *msg;
+
+ LOGPFSML(fi, LOGL_ERROR,
+ "The RAB-AssignmentResponse contains a RAB-FailedList, RAB-Assignment (%u) failed.\n",
+ mgw_fsm_priv->rab_id);
+
+ /* Forward the RAB-AssignmentResponse transparently. This will ensure that the MSC
+ * is informed about the problem. */
+ LOGPFSML(fi, LOGL_DEBUG, "forwarding unmodified RAB-AssignmentResponse to MSC\n");
+
+ msg = mgw_fsm_priv->ranap_rab_ass_resp_msgb;
+ mgw_fsm_priv->ranap_rab_ass_resp_msgb = NULL;
+ talloc_steal(OTC_SELECT, msg);
+
+ rc = map_sccp_dispatch(map, MAP_SCCP_EV_TX_DATA_REQUEST, msg);
+ if (rc < 0) {
+ LOGPFSML(fi, LOGL_DEBUG, "failed to forward RAB-AssignmentResponse message\n");
+ osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
+ }
+
+ /* Even though this is a failure situation, we still release normally as the error is located
+ * at the HNB. */
+ osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0);
+ return;
+ }
+
+ /* The RAB-ID we are dealing with is not on an FailedList and we were unable to parse the response
+ * normally. This is a situation we cannot recover from. */
+ LOGPFSML(fi, LOGL_ERROR, "Failed to extract RTP IP-address and Port from RAB-AssignmentResponse\n");
+ osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
+ return;
+ }
+
+ /* Break infinite loops modifications between HNB and our MGW: */
+ if (mgw_fsm_priv->mdcx_tx_cnt > 3) {
+ LOGPFSML(fi, LOGL_ERROR, "IuUP addr modification infinite loop detected between HNB and MGW, "
+ "check your network routing config -- abort!\n");
+ osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0);
+ return;
+ }
+
+ /* Send at least 1 MDCX in order to change conn_mode to SEND_RECV.
+ * From there on, MDCX is only needed if HNB IP/Port changed: */
+ if (mgw_fsm_priv->mdcx_tx_cnt == 0 ||
+ osmo_sockaddr_cmp(&addr, &mgw_fsm_priv->hnb_rtp_addr) != 0) {
+ next_st = MGW_ST_MDCX_HNB;
+ } else {
+ LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received with unchanged IuUP attributes, skipping MDCX...\n");
+ next_st = MGW_ST_CRCX_MSC;
+ }
+ mgw_fsm_priv->hnb_rtp_addr = addr;
+ mgw_fsm_state_chg(fi, next_st);
return;
default:
OSMO_ASSERT(false);
@@ -287,13 +353,8 @@
struct mgw_fsm_priv *mgw_fsm_priv = fi->priv;
struct hnbgw_context_map *map = mgw_fsm_priv->map;
struct mgcp_conn_peer mgw_info;
- struct osmo_sockaddr addr;
struct osmo_sockaddr_str addr_str;
- RANAP_RAB_AssignmentResponseIEs_t *ies;
int rc;
- bool rab_failed_at_hnb;
-
- LOGPFSML(fi, LOGL_DEBUG, "RAB-AssignmentResponse received, completing HNB side call-leg on MGW...\n");
mgw_info = (struct mgcp_conn_peer) {
.call_id = map->rua_ctx_id,
@@ -303,53 +364,17 @@
mgw_info.codecs[0] = CODEC_IUFP;
mgw_info.codecs_len = 1;
- ies = &mgw_fsm_priv->ranap_rab_ass_resp_message->msg.raB_AssignmentResponseIEs;
- rc = ranap_rab_ass_resp_ies_extract_inet_addr(&addr, ies, mgw_fsm_priv->rab_id);
- if (rc < 0) {
- rab_failed_at_hnb = ranap_rab_ass_resp_ies_check_failure(ies, mgw_fsm_priv->rab_id);
- if (rab_failed_at_hnb) {
- struct msgb *msg;
-
- LOGPFSML(fi, LOGL_ERROR,
- "The RAB-AssignmentResponse contains a RAB-FailedList, RAB-Assignment (%u) failed.\n",
- mgw_fsm_priv->rab_id);
-
- /* Forward the RAB-AssignmentResponse transparently. This will ensure that the MSC is informed
- * about the problem. */
- LOGPFSML(fi, LOGL_DEBUG, "forwarding unmodified RAB-AssignmentResponse to MSC\n");
-
- msg = mgw_fsm_priv->ranap_rab_ass_resp_msgb;
- mgw_fsm_priv->ranap_rab_ass_resp_msgb = NULL;
- talloc_steal(OTC_SELECT, msg);
-
- rc = map_sccp_dispatch(map, MAP_SCCP_EV_TX_DATA_REQUEST, msg);
- if (rc < 0) {
- LOGPFSML(fi, LOGL_DEBUG, "failed to forward RAB-AssignmentResponse message\n");
- osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
- }
-
- /* Even though this is a failure situation, we still release normally as the error is located
- * at the HNB. */
- osmo_fsm_inst_state_chg(fi, MGW_ST_RELEASE, 0, 0);
- return;
- }
-
- /* The RAB-ID we are dealing with is not on an FailedList and we were unable to parse the response
- * normally. This is a situation we cannot recover from. */
- LOGPFSML(fi, LOGL_ERROR, "Failed to extract RTP IP-address and Port from RAB-AssignmentResponse\n");
- osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
- return;
- }
-
- rc = osmo_sockaddr_str_from_sockaddr(&addr_str, &addr.u.sas);
+ rc = osmo_sockaddr_str_from_sockaddr(&addr_str, &mgw_fsm_priv->hnb_rtp_addr.u.sas);
if (rc < 0) {
LOGPFSML(fi, LOGL_ERROR, "Invalid RTP IP-address or Port in RAB-AssignmentResponse\n");
osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
return;
}
+
osmo_strlcpy(mgw_info.addr, addr_str.ip, sizeof(mgw_info.addr));
mgw_info.port = addr_str.port;
+ mgw_fsm_priv->mdcx_tx_cnt++;
osmo_mgcpc_ep_ci_request(mgw_fsm_priv->mgcpc_ep_ci_hnb, MGCP_VERB_MDCX, &mgw_info, fi, MGW_EV_MGCP_OK,
MGW_EV_MGCP_FAIL, NULL);
}
@@ -387,13 +412,14 @@
}
if (osmo_sockaddr_cmp(&mgw_fsm_priv->ci_hnb_crcx_ack_addr, &addr) != 0) {
- /* FIXME: Send RAB Modify Req to HNB. See OS#6127 */
char addr_buf[INET6_ADDRSTRLEN + 8];
- LOGPFSML(fi, LOGL_ERROR, "Local MGW IuUP IP address %s changed to %s during MDCX."
- " This is so far unsupported, adapt your osmo-mgw config!\n",
+ LOGPFSML(fi, LOGL_INFO, "Local MGW IuUP IP address %s changed to %s during MDCX."
+ " Modifying RAB on HNB.\n",
osmo_sockaddr_to_str(&mgw_fsm_priv->ci_hnb_crcx_ack_addr),
osmo_sockaddr_to_str_buf(addr_buf, sizeof(addr_buf), &addr));
- osmo_fsm_inst_state_chg(fi, MGW_ST_FAILURE, 0, 0);
+ /* Modify RAB on the HNB with the new local IuUP address (OS#6127): */
+ mgw_fsm_priv->ci_hnb_crcx_ack_addr = addr;
+ mgw_fsm_state_chg(fi, MGW_ST_ASSIGN);
return;
}
@@ -619,6 +645,7 @@
.in_event_mask = S(MGW_EV_RAB_ASS_RESP),
.out_state_mask =
S(MGW_ST_MDCX_HNB) |
+ S(MGW_ST_CRCX_MSC) |
S(MGW_ST_FAILURE) |
S(MGW_ST_RELEASE),
},
@@ -629,6 +656,7 @@
.in_event_mask =
S(MGW_EV_MGCP_OK),
.out_state_mask =
+ S(MGW_ST_ASSIGN) |
S(MGW_ST_CRCX_MSC) |
S(MGW_ST_FAILURE) |
S(MGW_ST_RELEASE),
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/35168?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I936a50fed38a201c4a8da99b40f07082049e5157
Gerrit-Change-Number: 35168
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged