diff options
author | Harald Welte <laforge@gnumonks.org> | 2014-01-19 15:10:06 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2014-01-21 23:38:59 +0100 |
commit | bc48e26fc91e0a24ec571904d1fab6dd351a5d48 (patch) | |
tree | 610b9830389c2a7615f817e1e2b6cd17443392d2 | |
parent | 8196de46ad4886afd3e3c6068e491b8132c5c16f (diff) |
common/rsl.c: Allow bts_model_rsl_chan_act() to return negative cause
If the channel couldn't be activated, the function can simply return
a negated RSL_ERR_* constant which will then be propagated towards
the BSC in an CHAN_ACT_NACK RSL message.
-rw-r--r-- | src/common/rsl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index b8e4c23c..8b7702b3 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -675,6 +675,7 @@ static int rsl_rx_chan_activ(struct msgb *msg) struct rsl_ie_chan_mode *cm; struct tlv_parsed tp; uint8_t type; + int rc; if (lchan->state != LCHAN_S_NONE) { LOGP(DRSL, LOGL_ERROR, @@ -788,7 +789,11 @@ static int rsl_rx_chan_activ(struct msgb *msg) /* actually activate the channel in the BTS */ lchan->rel_act_kind = LCHAN_REL_ACT_RSL; - return bts_model_rsl_chan_act(msg->lchan, &tp); + rc = bts_model_rsl_chan_act(msg->lchan, &tp); + if (rc < 0) + return rsl_tx_chan_act_nack(lchan, -rc); + + return 0; } /* 8.4.14 RF CHANnel RELease is received */ |