Change in osmo-remsim[master]: bankd: initialize bank_id/slot_nr to 0xffff for unmapped workers

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/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 4 20:53:13 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/16490 )


Change subject: bankd: initialize bank_id/slot_nr to 0xffff for unmapped workers
......................................................................

bankd: initialize bank_id/slot_nr to 0xffff for unmapped workers

Otherwise the loop for SIGMAPDEL delivery code will match any
unused worker for bank_id=0/slot_nr=0, which is not what we want.

This also makes repeated RemsimBankd_Tests.TC_removeMapping_connected
runs work reliably.

Change-Id: I6976eb96feae6a3b66bacf787e436a2df29f9ce0
---
M src/bankd/bankd_main.c
1 file changed, 5 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/90/16490/1

diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index 94227e3..09a9e1d 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -411,6 +411,8 @@
 {
 	LOGW(g_worker, "SIGMAPDEL received: Main thread informs us our map is gone\n");
 	OSMO_ASSERT(sig == SIGMAPDEL);
+	g_worker->slot.bank_id = 0xffff;
+	g_worker->slot.slot_nr = 0xffff;
 	worker_set_state(g_worker, BW_ST_CONN_CLIENT_UNMAPPED);
 }
 
@@ -852,6 +854,9 @@
 	/* push cleanup helper */
 	pthread_cleanup_push(&worker_cleanup, g_worker);
 
+	g_worker->slot.bank_id = 0xffff;
+	g_worker->slot.slot_nr = 0xffff;
+
 	/* we continuously perform the same loop here, recycling the worker thread
 	 * once the client connection is gone or we have some trouble with the card/reader */
 	while (1) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/16490
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I6976eb96feae6a3b66bacf787e436a2df29f9ce0
Gerrit-Change-Number: 16490
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191204/081d7d70/attachment.htm>


More information about the gerrit-log mailing list