Change in libosmo-abis[master]: ipaccess: Fix wrong assertion in ipaccess_drop() when used by BTS code

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
Mon Nov 23 13:59:31 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-abis/+/21282 )


Change subject: ipaccess: Fix wrong assertion in ipaccess_drop() when used by BTS code
......................................................................

ipaccess: Fix wrong assertion in ipaccess_drop() when used by BTS code

The code wrongly assumed that ipaccess_drop was only called by BSC code,
which is wrong. ipaccess_drop is called by BTS run code path in __handle_ts1_write(),
if send() syscall fails (for instance because BSC becomes unreachable).
In that case, we need to account for the BTS role case which doesn't
store the line pointer into the ofd->data. In BTS case, it's a pointer
to the struct ipa_client_conn, which we leave up to sign_link_down() cb
to do whatever they please with.

Fixes: OS#4864
Change-Id: If763e5f7736921a4360ad9027ba075ef8e118934
---
M src/input/ipaccess.c
1 file changed, 17 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/82/21282/1

diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 48a427c..1036e51 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -92,13 +92,23 @@
 		osmo_fd_unregister(bfd);
 		close(bfd->fd);
 		bfd->fd = -1;
-		/* This is BSC code, ipaccess_drop() is only called for
-		   accepted() sockets, hence the bfd holds a reference to
-		   e1inp_line in ->data that needs to be released */
-		OSMO_ASSERT(bfd->data == line);
-		bfd->data = NULL;
-		e1inp_line_put2(line, "ipa_bfd");
-
+		switch(line->ops->cfg.ipa.role) {
+		case E1INP_LINE_R_BSC:
+			/* This is BSC code, ipaccess_drop() is only called for
+			   accepted() sockets, hence the bfd holds a reference to
+			   e1inp_line in ->data that needs to be released */
+			OSMO_ASSERT(bfd->data == line);
+			bfd->data = NULL;
+			e1inp_line_put2(line, "ipa_bfd");
+			break;
+		case E1INP_LINE_R_BTS:
+			/* BTS code: bfd->data contains pointer to struct
+			 * ipa_client_conn. Leave it alive so it reconnects.
+			 */
+			break;
+		default:
+			break;
+		}
 		ret = -ENOENT;
 	} else {
 		LOGPITS(e1i_ts, DLINP, LOGL_ERROR,

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

Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: If763e5f7736921a4360ad9027ba075ef8e118934
Gerrit-Change-Number: 21282
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201123/07aa36e9/attachment.htm>


More information about the gerrit-log mailing list