diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2019-05-25 05:41:18 +0200 |
---|---|---|
committer | Alexander Couzens <lynxis@fe80.eu> | 2019-06-07 01:17:53 +0200 |
commit | 5c3783b7e83b586d72304d798b195bffa1a53ba2 (patch) | |
tree | 369326edd4143ea94095141e2e90ee56d010407f /tests/emu | |
parent | a558ad426951f6f536c4bc7bef302afbd3573ce6 (diff) |
gprs_bssgp_pcu: explicit allocate & initialize bssgp_nsi instance
The instance bssgp_nsi is a global instance to be used by all
NS related functions. Previous the PCU allocated and initialized
the bssgp_nsi instance when (re-)connecting and freeing on disconnect.
The problem of the implicit initialisation is gprs_ns_vty_init(bssgp_nsi).
All vty init functions must be called before the configuration is read,
otherwise a previous vty written configuration is invalid.
Furthermore the vty modifications to the `ns` object were lost when the PCU has to
reconnect to the SGSN.
Fixes: OS#4024
Change-Id: I2aa53ea54e9352577f6280ad7b9d1d9da9f57eaf
Diffstat (limited to 'tests/emu')
-rw-r--r-- | tests/emu/pcu_emu.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/emu/pcu_emu.cpp b/tests/emu/pcu_emu.cpp index 354a3286..e0190bfb 100644 --- a/tests/emu/pcu_emu.cpp +++ b/tests/emu/pcu_emu.cpp @@ -113,6 +113,13 @@ int main(int argc, char **argv) msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging2(tall_pcu_ctx, &gprs_log_info); + + bssgp_nsi = gprs_ns_instantiate(&gprs_bssgp_ns_cb, tall_pcu_ctx); + if (!bssgp_nsi) { + LOGP(DBSSGP, LOGL_ERROR, "Failed to create NS instance\n"); + abort(); + } + vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); |