fix RSL Chan Activ Nack messages

In early rsl_rx_chan_activ(), do not use rsl_tx_chan_act_acknack() to trigger
sending a NACK, instead use rsl_tx_chan_act_nack() directly.

Rationale: the previously used rsl_tx_chan_act_acknack() may decide to omit the
NACK, particularly based on the lchan->rel_act_kind. lchan->rel_act_kind
indicates whether the Chan Release or Activation was explicitly requested via
RSL, and thus whether an ACK/NACK should go back to RSL or not. This gets set
only late in rsl_rx_chan_activ(). We cannot set it on top, because we need to
first establish whether the Chan Activ is permitted or not. In case of early
rejection of the Chan Activ, we do not want to modify the lchan state, but
merely reply with a NACK, unconditionally.

Before this patch, NACKs that rsl_rx_chan_activ() wants to trigger would
possibly be not be sent out on RSL, because lchan->rel_act_kind is not
explicitly initialized until later.

Fixes: BTS_Tests.TC_dyn_ipa_pdch_act_tchf_act_nack
Change-Id: Ic981f768cc024f0acd3d7ae55846cfbc7bc089ce
This commit is contained in:
Neels Hofmeyr 2018-05-08 21:26:36 +02:00
parent 0958278fb9
commit ba7ed220be
1 changed files with 4 additions and 6 deletions

View File

@ -966,7 +966,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
LOGP(DRSL, LOGL_ERROR,
"%s: error: lchan is not available, but in state: %s.\n",
gsm_lchan_name(lchan), gsm_lchans_name(lchan->state));
return rsl_tx_chan_act_acknack(lchan, RSL_ERR_EQUIPMENT_FAIL);
return rsl_tx_chan_act_nack(lchan, RSL_ERR_EQUIPMENT_FAIL);
}
if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) {
@ -981,8 +981,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
*/
rc = dyn_ts_l1_reconnect(ts, msg);
if (rc)
return rsl_tx_chan_act_acknack(lchan,
RSL_ERR_NORMAL_UNSPEC);
return rsl_tx_chan_act_nack(lchan, RSL_ERR_NORMAL_UNSPEC);
/* indicate that the msgb should not be freed. */
return 1;
}
@ -998,7 +997,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* 9.3.3 Activation Type */
if (!TLVP_PRESENT(&tp, RSL_IE_ACT_TYPE)) {
LOGP(DRSL, LOGL_NOTICE, "missing Activation Type\n");
return rsl_tx_chan_act_acknack(lchan, RSL_ERR_MAND_IE_ERROR);
return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR);
}
type = *TLVP_VAL(&tp, RSL_IE_ACT_TYPE);
@ -1006,8 +1005,7 @@ static int rsl_rx_chan_activ(struct msgb *msg)
if (type != RSL_ACT_OSMO_PDCH) {
if (!TLVP_PRESENT(&tp, RSL_IE_CHAN_MODE)) {
LOGP(DRSL, LOGL_NOTICE, "missing Channel Mode\n");
return rsl_tx_chan_act_acknack(lchan,
RSL_ERR_MAND_IE_ERROR);
return rsl_tx_chan_act_nack(lchan, RSL_ERR_MAND_IE_ERROR);
}
cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE);
lchan_tchmode_from_cmode(lchan, cm);