diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-07-11 16:13:38 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-07-27 22:15:04 +0200 |
commit | a30f47613abb7c22a26d534d66e478265a8c2c09 (patch) | |
tree | 04374e0b4f096c71e9fb0a8f5262b2a3aa7c672d /src/gprs_bssgp_pcu.cpp | |
parent | 51c57045e533caaa51ca5acf8929628c21dd6b94 (diff) |
misc: Add an option exit/quit when the BSSGP is supposed to be destroyed
The PCU does not properly re-set the state when the connection to the
BTS is lost (and the SGSN potentially is re-started during that). This
results in the BSSGP BVCI > 1 remaining blocked and no data will be
accepted by the SGSN.
Add the '-e' option and exit the PCU when the BSSGP/NS are getting
destroyed.
Diffstat (limited to 'src/gprs_bssgp_pcu.cpp')
-rw-r--r-- | src/gprs_bssgp_pcu.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index c7919138..59185e35 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -27,6 +27,7 @@ struct bssgp_bvc_ctx *bctx = NULL; struct gprs_nsvc *nsvc = NULL; static int bvc_sig_reset = 0, bvc_reset = 0, bvc_unblocked = 0; extern uint16_t spoof_mcc, spoof_mnc; +static int exit_on_destroy = 0; struct osmo_timer_list bvc_timer; @@ -640,8 +641,13 @@ int gprs_bssgp_create(uint16_t local_port, uint32_t sgsn_ip, return 0; } -void gprs_bssgp_destroy(void) +void gprs_bssgp_destroy_or_exit(void) { + if (exit_on_destroy) { + LOGP(DBSSGP, LOGL_NOTICE, "Exiting on BSSGP destruction.\n"); + exit(0); + } + if (!bssgp_nsi) return; @@ -662,3 +668,8 @@ void gprs_bssgp_destroy(void) bssgp_nsi = NULL; } +void gprs_bssgp_exit_on_destroy(void) +{ + LOGP(DBSSGP, LOGL_NOTICE, "Going to quit on BSSGP destruction\n"); + exit_on_destroy = 1; +} |