aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-22 02:50:50 +0300
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-10-22 02:51:33 +0300
commite3818832b05f84ba9af6a225cca82e2e8940c6c2 (patch)
tree20bf0ef31c84743ca72859d676b5f0b752794b75 /src/common/rsl.c
parent26417d45749ca95d987c83b4104923844f268af2 (diff)
rsl: send NACK if BTS_FEAT_ACCH_REP is not supported
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index d14395b8..3cbfff63 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1566,7 +1566,7 @@ static enum gsm_phys_chan_config dyn_pchan_from_chan_nr(uint8_t chan_nr)
}
/* Parse RSL_IE_OSMO_REP_ACCH_CAP */
-static void parse_repeated_acch_capability(struct gsm_lchan *lchan, struct tlv_parsed *tp)
+static int parse_repeated_acch_capability(struct gsm_lchan *lchan, struct tlv_parsed *tp)
{
/* 3GPP TS 24.008, section 10.5.1.7 defines a Repeated ACCH Capability
* bit that indicates if REPEATED FACCH/SACCH is supported or not.
@@ -1577,10 +1577,15 @@ static void parse_repeated_acch_capability(struct gsm_lchan *lchan, struct tlv_p
memset(&lchan->repeated_acch_capability, 0, sizeof(lchan->repeated_acch_capability));
if (!TLVP_PRES_LEN(tp, RSL_IE_OSMO_REP_ACCH_CAP, sizeof(lchan->repeated_acch_capability)))
- return;
+ return 0;
+
+ if (!osmo_bts_has_feature(lchan->ts->trx->bts->features, BTS_FEAT_ACCH_REP))
+ return -RSL_ERR_OPT_IE_ERROR;
memcpy(&lchan->repeated_acch_capability, TLVP_VAL(tp, RSL_IE_OSMO_REP_ACCH_CAP),
sizeof(lchan->repeated_acch_capability));
+
+ return 0;
}
/* Parse RSL_IE_OSMO_TOP_ACCH_CAP */
@@ -1912,7 +1917,9 @@ static int rsl_rx_chan_activ(struct msgb *msg)
/* Remember to send an RSL ACK once the lchan is active */
lchan->rel_act_kind = LCHAN_REL_ACT_RSL;
- parse_repeated_acch_capability(lchan, &tp);
+ rc = parse_repeated_acch_capability(lchan, &tp);
+ if (rc < 0)
+ return rsl_tx_chan_act_acknack(lchan, -rc);
rc = parse_temporary_overpower_acch_capability(lchan, &tp);
if (rc < 0)
return rsl_tx_chan_act_acknack(lchan, -rc);
@@ -2180,7 +2187,9 @@ static int rsl_rx_mode_modif(struct msgb *msg)
/* 9.3.53 MultiRate Control */
/* 9.3.54 Supported Codec Types */
- parse_repeated_acch_capability(lchan, &tp);
+ rc = parse_repeated_acch_capability(lchan, &tp);
+ if (rc < 0)
+ return rsl_tx_mode_modif_nack(lchan, -rc);
rc = parse_temporary_overpower_acch_capability(lchan, &tp);
if (rc < 0)
return rsl_tx_mode_modif_nack(lchan, -rc);