neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/33173 )
Change subject: cnpool: add context_map_cnlink_lost() handling
......................................................................
cnpool: add context_map_cnlink_lost() handling
When proper RANAP RESET handling is in place [1], a specific CN link may
be detected to be disconnected or reconnected at any point.
[1] Id3eefdea889a736fd5957b80280fa45b9547b792
When that happens, all related context maps should disconnect RUA and
SCCP links immediately. Add the context map side of this, so that
context_map_cnlink_lost() is ready to be dispatched in [1].
Related: SYS#6412
Change-Id: Ic0a6fcfb747dc093528ca2bd12a269ad390d465c
---
M include/osmocom/hnbgw/context_map.h
M src/osmo-hnbgw/context_map.c
M src/osmo-hnbgw/context_map_sccp.c
3 files changed, 37 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/73/33173/1
diff --git a/include/osmocom/hnbgw/context_map.h b/include/osmocom/hnbgw/context_map.h
index f7335a7..1641a84 100644
--- a/include/osmocom/hnbgw/context_map.h
+++ b/include/osmocom/hnbgw/context_map.h
@@ -66,6 +66,8 @@
/* The human admin asks to drop the current SCCP connection, by telnet VTY 'apply sccp' in presence of SCCP
* config changes. */
MAP_SCCP_EV_USER_ABORT,
+ /* The CN link has RESET */
+ MAP_SCCP_EV_CN_LINK_LOST,
};
/* For context_map_get_state(), to combine the RUA and SCCP states, for VTY reporting only. */
@@ -186,6 +188,7 @@
bool map_rua_is_active(struct hnbgw_context_map *map);
bool map_sccp_is_active(struct hnbgw_context_map *map);
+void context_map_cnlink_lost(struct hnbgw_context_map *map);
void context_map_free(struct hnbgw_context_map *map);
unsigned int msg_has_l2_data(const struct msgb *msg);
diff --git a/src/osmo-hnbgw/context_map.c b/src/osmo-hnbgw/context_map.c
index 045053c..73a7ecc 100644
--- a/src/osmo-hnbgw/context_map.c
+++ b/src/osmo-hnbgw/context_map.c
@@ -183,6 +183,11 @@
map_rua_dispatch(map, MAP_RUA_EV_HNB_LINK_LOST, NULL);
}
+void context_map_cnlink_lost(struct hnbgw_context_map *map)
+{
+ map_sccp_dispatch(map, MAP_SCCP_EV_RAN_LINK_LOST, NULL);
+}
+
void context_map_free(struct hnbgw_context_map *map)
{
/* guard against FSM termination infinitely looping back here */
diff --git a/src/osmo-hnbgw/context_map_sccp.c b/src/osmo-hnbgw/context_map_sccp.c
index 1f2cd09..9b4837d 100644
--- a/src/osmo-hnbgw/context_map_sccp.c
+++ b/src/osmo-hnbgw/context_map_sccp.c
@@ -55,6 +55,7 @@
OSMO_VALUE_STRING(MAP_SCCP_EV_RAN_LINK_LOST),
OSMO_VALUE_STRING(MAP_SCCP_EV_RX_RELEASED),
OSMO_VALUE_STRING(MAP_SCCP_EV_USER_ABORT),
+ OSMO_VALUE_STRING(MAP_SCCP_EV_CN_LINK_LOST),
{}
};
@@ -284,6 +285,7 @@
case MAP_SCCP_EV_RAN_LINK_LOST:
case MAP_SCCP_EV_RAN_DISC:
case MAP_SCCP_EV_USER_ABORT:
+ case MAP_SCCP_EV_CN_LINK_LOST:
/* No CR has been sent yet, just go to disconnected state. */
if (msg_has_l2_data(ranap_msg))
LOG_MAP(map, DLSCCP, LOGL_ERROR, "SCCP not connected, cannot dispatch RANAP message\n");
@@ -321,6 +323,7 @@
case MAP_SCCP_EV_RAN_LINK_LOST:
case MAP_SCCP_EV_RAN_DISC:
case MAP_SCCP_EV_USER_ABORT:
+ case MAP_SCCP_EV_CN_LINK_LOST:
/* RUA connection was terminated. First wait for the CC before releasing the SCCP conn. */
if (msg_has_l2_data(ranap_msg))
LOGPFSML(fi, LOGL_ERROR, "Connection not yet confirmed, cannot forward RANAP to CN\n");
@@ -379,6 +382,8 @@
* Disconnect on the SCCP layer, ungracefully. */
case MAP_SCCP_EV_USER_ABORT:
/* The user is asking for disconnection, so there is no Iu Release in progress. Disconnect now. */
+ case MAP_SCCP_EV_CN_LINK_LOST:
+ /* The CN peer has sent a RANAP RESET, so the old link that this map ran on is lost */
/* There won't be any ranap_msg, but if a caller wants to dispatch a msg, forward it before
* disconnecting. */
@@ -448,6 +453,7 @@
return;
case MAP_SCCP_EV_USER_ABORT:
+ case MAP_SCCP_EV_CN_LINK_LOST:
/* Stop waiting for RLSD, send RLSD now. */
tx_sccp_rlsd(fi);
map_sccp_fsm_state_chg(MAP_SCCP_ST_DISCONNECTED);
@@ -525,6 +531,7 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_USER_ABORT)
+ | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_INIT)
@@ -542,6 +549,7 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_USER_ABORT)
+ | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_CONNECTED)
@@ -559,6 +567,7 @@
| S(MAP_SCCP_EV_RX_RELEASED)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
| S(MAP_SCCP_EV_USER_ABORT)
+ | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_WAIT_RLSD)
@@ -577,6 +586,7 @@
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_RX_CONNECTION_CONFIRM)
| S(MAP_SCCP_EV_USER_ABORT)
+ | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.out_state_mask = 0
| S(MAP_SCCP_ST_DISCONNECTED)
@@ -591,6 +601,7 @@
| S(MAP_SCCP_EV_RAN_DISC)
| S(MAP_SCCP_EV_RAN_LINK_LOST)
| S(MAP_SCCP_EV_USER_ABORT)
+ | S(MAP_SCCP_EV_CN_LINK_LOST)
,
.onenter = map_sccp_disconnected_onenter,
.action = map_sccp_disconnected_action,
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/33173
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: Ic0a6fcfb747dc093528ca2bd12a269ad390d465c
Gerrit-Change-Number: 33173
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33164 )
Change subject: struct osmo_sub_auth_data: remove OSMO_DEPRECATED_OUTSIDE
......................................................................
Patch Set 1:
(1 comment)
This change is ready for review.
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/33164/comment/11914c59_5186c179
PS1, Line 11: this attribute spams compilation logs of projects
: including file <osmocom/crypt/auth.h>, even if the deprecated struct
: is not used directly at all.
This looks like a compiler/version specific behavior. I am not seeing these false-positive warnings with gcc v13.1.1, but there's lots of them in the build logs on Jenkins, e.g. https://jenkins.osmocom.org/jenkins/view/master/job/master-osmo-bsc/22014/a… (grep for `Wdeprecated`).
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33164
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ia5d365206207872d5d3fdd4ae40273eab909fb33
Gerrit-Change-Number: 33164
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Mon, 05 Jun 2023 13:12:36 +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/osmo-hnbgw/+/33133 )
Change subject: cnpool: extract Mobile Identity from RANAP payload
......................................................................
Patch Set 2:
(3 comments)
File src/osmo-hnbgw/hnbgw_l3.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33133/comment/80deffe1_565dfd7e
PS2, Line 1: /* OsmoHNBGW implementation of CS and PS Level3 message decoding (NAS PDU */
> missing ")"
Done
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33133/comment/701b23d3_d105c36a
PS2, Line 104: /* Old routing area identification 10.5.5.15. */
> ack, thx. […]
problem, gsm48_parse_ra() returns struct gprs_ra_id, but i want struct osmo_routing_area_id, which uses struct osmo_plmn_id so that I can use osmo_plmn_cmp() on it... seems we have a bit of code split.
i guess there could be one static function for decoding old RA id for here and below? cannot find a public API function for struct osmo_routing_area_id.
any better ideas...?
https://gerrit.osmocom.org/c/osmo-hnbgw/+/33133/comment/6768f7a6_b881cb6c
PS2, Line 132: /* Old routing area identification 10.5.5.15 */
> gsm48_parse_ra
(same as above)
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/33133
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I373d665c9684b607207f68094188eab63209db51
Gerrit-Change-Number: 33133
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 05 Jun 2023 13:06:50 +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