From 3f7bd192a6ddd3a417ca41255f0071c32d050114 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Tue, 14 Sep 2021 18:49:49 +0200 Subject: abis.c: Fix mess with priv->bsc_oml_host The pointer was used as "struct bsc_oml_host" sometimes, and other times as "struct llist_head". It just worked because bsc_oml_host->list is the first item in the script. The code was really confusing, also because the bts list of items has a name really similar to the one currently assigned. Let's rename the currently assigned address to "current_bsc", store it always as "struct bsc_oml_host*" and finally use llist_entry helpers when needed. The related code is also moved to a helper function to enclose there the logic to get next BSC in list. This change actually changes the logic where a remote address is removed from VTY, since now the next address in list is picked at the time, and later when reconnecting the list is forwarded another time, meaning one address will be skipped. This could be considered a bug, but this situation is really special and anyway the entire logic will be changed in new commits where we'll keep reconnecting in loop without exiting when reaching the end of the list, so we are fine with it. Think of this commit as a preparation commit for next ones. Change-Id: I3cc8a4148b3d63bc185b72dab8108105a6644910 --- include/osmo-bts/abis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/osmo-bts') diff --git a/include/osmo-bts/abis.h b/include/osmo-bts/abis.h index 1939faf9..40707cd1 100644 --- a/include/osmo-bts/abis.h +++ b/include/osmo-bts/abis.h @@ -9,7 +9,7 @@ enum abis_link_fsm_event { ABIS_LINK_EV_SIGN_LINK_OML_UP, ABIS_LINK_EV_SIGN_LINK_DOWN, - ABIS_LINK_EV_VTY_RM_ADDR, + ABIS_LINK_EV_VTY_RM_ADDR, /* data: struct bsc_oml_host* being removed */ }; void abis_init(struct gsm_bts *bts); -- cgit v1.2.3