look-up by (subscriber, protocol, transaction_id) tuple

... rather than the previous incomplete (lchan, transaction_id) tuple
This commit is contained in:
Harald Welte 2009-07-23 21:58:40 +02:00
parent 78283ef151
commit b8b4073e18
3 changed files with 9 additions and 5 deletions

View File

@ -4,7 +4,8 @@
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_subscriber.h>
struct gsm_trans *trans_find_by_id(struct gsm_lchan *lchan, u_int8_t trans_id);
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
u_int8_t proto, u_int8_t trans_id);
struct gsm_trans *trans_find_by_callref(struct gsm_network *net,
u_int32_t callref);

View File

@ -3544,7 +3544,7 @@ static int gsm0408_rcv_cc(struct msgb *msg)
}
/* Find transaction */
trans = trans_find_by_id(lchan, transaction_id);
trans = trans_find_by_id(lchan->subscr, GSM48_PDISC_CC, transaction_id);
DEBUGP(DCC, "(bts %d trx %d ts %d ti %x sub %s) "
"Received '%s' from MS in state %d (%s)\n",

View File

@ -31,13 +31,16 @@
static void *tall_trans_ctx;
struct gsm_trans *trans_find_by_id(struct gsm_lchan *lchan, u_int8_t trans_id)
struct gsm_trans *trans_find_by_id(struct gsm_subscriber *subscr,
u_int8_t proto, u_int8_t trans_id)
{
struct gsm_trans *trans;
struct gsm_network *net = lchan->ts->trx->bts->network;
struct gsm_network *net = subscr->net;
llist_for_each_entry(trans, &net->trans_list, entry) {
if (trans->lchan == lchan && trans->transaction_id == trans_id)
if (trans->subscr == subscr &&
trans->protocol == proto &&
trans->transaction_id == trans_id)
return trans;
}
return NULL;