aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-09-29 14:15:56 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2021-09-29 14:32:13 +0200
commitd2d28d83a437f7478a4dfff0c6cae5305801b881 (patch)
tree67ffa79771ee33ee6ec9cf25aa14519d5b1c932b
parentdd48e257ab0448d70b1caa237b57c6c2954b6e90 (diff)
ipaccess: Allow reconfiguring the ipa line during line_update()
The e1inp_line_update() API is precisely aimed at that: tell that we want to reconfigure some aspects of the e1 line. Hence, it makes no sense to apply a no-op with the flag "line_already_initialized". That flag was added a long time ago in order to avoid problems when several BTS are attached to the same ipa server link. That case doesn't apply to the BTS role, so we can simply recreate the ipa_cli_conn. Fixes: d6216405b7363c94174a6d301b96f5ed4a8730ce Change-Id: Iff8092f88726cf238dac2abb99e135ac5864272d
-rw-r--r--src/input/ipaccess.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index a584e0d..63461a2 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -1005,6 +1005,7 @@ err:
struct ipaccess_line {
bool line_already_initialized;
+ struct ipa_client_conn *ipa_cli;
};
static int ipaccess_line_update(struct e1inp_line *line)
@@ -1021,12 +1022,11 @@ static int ipaccess_line_update(struct e1inp_line *line)
}
il = line->driver_data;
- /* We only initialize this line once. */
- if (il->line_already_initialized)
- return 0;
-
switch(line->ops->cfg.ipa.role) {
case E1INP_LINE_R_BSC: {
+ /* We only initialize this line once. */
+ if (il->line_already_initialized)
+ return 0;
struct ipa_server_link *oml_link, *rsl_link;
const char *ipa = e1inp_ipa_get_bind_addr();
@@ -1077,6 +1077,13 @@ static int ipaccess_line_update(struct e1inp_line *line)
"OML connecting to %s:%u\n", line->ops->cfg.ipa.addr,
IPA_TCP_PORT_OML);
+ /* Drop previous line */
+ if (il->ipa_cli) {
+ ipa_client_conn_close(il->ipa_cli);
+ ipa_client_conn_destroy(il->ipa_cli);
+ il->ipa_cli = NULL;
+ }
+
link = ipa_client_conn_create2(tall_ipa_ctx,
e1inp_line_ipa_oml_ts(line),
E1INP_SIGN_OML,
@@ -1104,6 +1111,7 @@ static int ipaccess_line_update(struct e1inp_line *line)
e1i_ts = e1inp_line_ipa_oml_ts(line);
ipaccess_bts_keepalive_fsm_alloc(e1i_ts, link, "oml_bts_to_bsc");
+ il->ipa_cli = link;
ret = 0;
break;
}