diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-03-09 17:11:45 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-03-24 21:22:21 +0100 |
commit | 764449ec2ea6d6b45239278eae90613df8c93f59 (patch) | |
tree | f25eeef115083e20eaa7c4713b18d1889e7b865e /tests/gsm0408 | |
parent | dc60505bc585b1d5f61aa7190b3a2f14fecacaa1 (diff) |
fix/refactor neighbor config
The neighbor configuration storage is fundamentally broken: it requires
all local cells to be configured before being able to list them as
neighbors of each other. Upon config write-back, the neighbor config
however is placed back inline with the other config, and hence a
written-out neighbor config no longer works on program restart.
The cause of this problem is that the config is stored as explicit
pointers between local cells (struct gsm_bts), which of course requires
the pointer to exist before being able to reference it.
Instead, store the actual configuration that the user entered as-is,
without pointers or references to objects that need to be ready. Resolve
the neighbors every time a neighbor is needed.
Hence the user may enter any config at any place in the config file,
even non-working config (like a BTS number that doesn't exist), and the
relation to actual local or remote neighbor cells is made at runtime.
Abort program startup if the initial neighbor configuration contains
errors.
Related: OS#5018
Change-Id: I9ed992f8bfff888b3933733c0576f92d50f2625b
Diffstat (limited to 'tests/gsm0408')
-rw-r--r-- | tests/gsm0408/gsm0408_test.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index c23b26285..754538104 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -59,6 +59,7 @@ } +struct gsm_network *bsc_gsmnet = NULL; static inline void gen(struct gsm_bts *bts, const char *s) { @@ -899,6 +900,7 @@ int main(int argc, char **argv) printf("Network init failure.\n"); return EXIT_FAILURE; } + bsc_gsmnet = net; test_si_range_helpers(); test_arfcn_filter(); |