diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2013-06-12 08:20:36 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-12-01 03:37:43 +0100 |
commit | 76802f9d478990edc391c01ed1840ddfab81c71d (patch) | |
tree | 4b99b2a77aff6d349bf4dc27177db70fe93538e7 /src/libbsc/bsc_api.c | |
parent | a6e8467e55af538ab89c442cefca2f9816d2b73d (diff) |
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.
Diffstat (limited to 'src/libbsc/bsc_api.c')
-rw-r--r-- | src/libbsc/bsc_api.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 75bb3e100..991c44dfa 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -210,6 +210,13 @@ static int handle_new_assignment(struct gsm_subscriber_connection *conn, int cha 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; |