Change in libosmo-abis[master]: ipaccess: Allow reconfiguring the ipa line during line_update()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Sep 29 14:36:58 UTC 2021


pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-abis/+/25639 )

Change subject: ipaccess: Allow reconfiguring the ipa line during line_update()
......................................................................

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
---
M src/input/ipaccess.c
1 file changed, 12 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  daniel: Looks good to me, but someone else must approve
  osmith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



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 @@
 
 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 @@
 	}
 	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 @@
 		     "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 @@
 
 		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;
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/25639
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Iff8092f88726cf238dac2abb99e135ac5864272d
Gerrit-Change-Number: 25639
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210929/83d1653a/attachment.htm>


More information about the gerrit-log mailing list