aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-06-26 15:55:21 +0200
committerlaforge <laforge@osmocom.org>2020-07-27 14:43:36 +0000
commit9d16b14345fa3f20161586fa54659187be0d37e5 (patch)
tree62f0ae6f93bf4f7a6c779bf9ede0f558313c0b19
parentdd930a25ad3f9e03cd5438deebc499b5a8655f29 (diff)
Send a BVC-RESET to all persistent Gb interfaces at start-upHEADmaster
3GPP TS 48.018 Section 8.4: > After any failure affecting the NSE, the party (BSS or SGSN) where > the failure resided shall reset the signalling BVC. After sending or > receiving a BVC-RESET PDU for the signalling BVC, the BSS shall stop all > traffic and initiate the BVC-RESET procedure for all BVCs corresponding > to PTP functional entities of the underlying network service entity. The > BSS must complete the BVC-RESET procedure for signalling BVC before > starting PTP BVC-RESET procedures. TODO: We should not just trigger a single outbound BVC-RESET message, but we should re-transmit them until we get a response. This would likely entail adding FSMs to libosmogb, which we will leave for a later point - it's anticipated that the NS + BSSGP code is undergoing quite some changes in the coming months anyway, so leave it for then. Change-Id: I0b46035b40709c38bb9ab9493c11031a577e3ee0 Closes: OS#4629 Depends: libosmocore.git I353adc1aa72377f7d4b3336d2ff47791fb73d62c
-rw-r--r--src/sgsn/sgsn_main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index 3b18b051..5b538155 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -42,6 +42,7 @@
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gprs/gprs_bssgp_bss.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
@@ -199,6 +200,23 @@ int sgsn_vty_go_parent(struct vty *vty)
#endif
}
+static void bvc_reset_persistent_nsvcs(void)
+{
+ /* Send BVC-RESET on all persistent NSVCs */
+ struct gprs_nsvc *nsvc;
+
+ llist_for_each_entry(nsvc, &sgsn_nsi->gprs_nsvcs, list) {
+ struct bssgp_bvc_ctx bctx = {
+ .nsei = nsvc->nsei,
+ };
+ if (!nsvc->persistent)
+ continue;
+ /* if it is not marked ALIVE, we cannot send any data over it. */
+ nsvc->state |= NSE_S_ALIVE;
+ bssgp_tx_bvc_reset2(&bctx, BVCI_SIGNALLING, BSSGP_CAUSE_EQUIP_FAIL, false);
+ }
+}
+
static struct vty_app_info vty_info = {
.name = "OsmoSGSN",
.version = PACKAGE_VERSION,
@@ -522,6 +540,8 @@ int main(int argc, char **argv)
ranap_iu_init(tall_sgsn_ctx, DRANAP, "OsmoSGSN-IuPS", sccp, gsm0408_gprs_rcvmsg_iu, sgsn_ranap_iu_event);
#endif
+ bvc_reset_persistent_nsvcs();
+
if (daemonize) {
rc = osmo_daemonize();
if (rc < 0) {