diff options
author | Harald Welte <laforge@netfilter.org> | 2009-12-21 23:01:33 +0100 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-12-21 23:01:33 +0100 |
commit | 1394fea03f888408616cac3a669191f2e6923c8f (patch) | |
tree | 7fb800dd128bf755de346c1756a0518ba4cfb05c /openbsc/src/input | |
parent | 6a22c0135a6ac49d716d38a92c9d9c9a329da980 (diff) |
ipaccess: Fix two minor bugs regarding multi-TRX setup
we need to set newbfd->priv_nr to 2+trx_id, rather than keeping
it '2' all the time, as it is used to look-up the e1i_ts when
we receive a packet. A constant '2' would always match to TRX 0.
we also need to keep one separate bit for each TRX state in order
to properly generate the EVT_E1_TEI_UP event for trx > 0.
Diffstat (limited to 'openbsc/src/input')
-rw-r--r-- | openbsc/src/input/ipaccess.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c index 143712e1c..6bd501df1 100644 --- a/openbsc/src/input/ipaccess.c +++ b/openbsc/src/input/ipaccess.c @@ -238,6 +238,7 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, trx->rsl_tei, 0); /* get rid of our old temporary bfd */ memcpy(newbfd, bfd, sizeof(*newbfd)); + newbfd->priv_nr = 2+trx_id; bsc_unregister_fd(bfd); bsc_register_fd(newbfd); talloc_free(bfd); @@ -347,9 +348,9 @@ static int handle_ts1_read(struct bsc_fd *bfd) switch (link->type) { case E1INP_SIGN_RSL: - if (!(msg->trx->bts->ip_access.flags & RSL_UP)) { + if (!(msg->trx->bts->ip_access.flags & (RSL_UP << msg->trx->nr))) { e1inp_event(e1i_ts, EVT_E1_TEI_UP, link->tei, link->sapi); - msg->trx->bts->ip_access.flags |= RSL_UP; + msg->trx->bts->ip_access.flags |= (RSL_UP << msg->trx->nr); } ret = abis_rsl_rcvmsg(msg); break; |