[PATCH] osmo-bsc[master]: Do not perform assignment, if the new channel equals the cur...

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Fri Jan 19 03:04:00 UTC 2018


Review at  https://gerrit.osmocom.org/5908

Do not perform assignment, if the new channel equals the current one

This can happen, if a TCH/H was requested, but because it is not available,
a TCH/F is allocated. If the old channel was TCH/F already, it makes no
sense to assign it.

Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae
---
M src/libbsc/bsc_api.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/5908/1

diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index ec64bb8..53d0281 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -221,6 +221,13 @@
 		return -1;
 	}
 
+	/* check if we are on TCH/F and requested TCH/H, but got TCH/F */
+	if (conn->lchan->type == new_lchan->type) {
+		lchan_free(new_lchan);
+		LOGP(DMSC, LOGL_NOTICE, "Not assign to equal channel rate.\n");
+		return -1;
+	}
+
 	/* copy old data to the new channel */
 	memcpy(&new_lchan->encr, &conn->lchan->encr, sizeof(new_lchan->encr));
 	new_lchan->ms_power = conn->lchan->ms_power;

-- 
To view, visit https://gerrit.osmocom.org/5908
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list