aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-07-14 09:44:19 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-07-14 09:55:56 +0200
commita7c276b72b07b8b713c5d9af869159690e073441 (patch)
tree71848307fb646cb08c5a348644662d5b2cbcc1b1
parentf869a95f3b81d281405e3fc3026e1d0d53174082 (diff)
meas: Do not send incomplete measurement reports
The RSL_IE_MEAS_RES_NR is mandatory element with a minimum of 5 octets (two for TL and three for the value). When we establish a new channel we might not have had enough time in a TDMA frame to calculate the average. The issue is not easy to reproduce. At the point we receive the measurement report we have two uplink measurements queued. As it is not easy to reproduce and only occurs when a channel is new I have decided to drop the message instead of sending made up uplink measurement reports. As of now lchan_build_rsl_ul_meas will always return 3 and the condition will never be false. Avoids: SYS#1781
-rw-r--r--src/common/rsl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 0c9acf54..1be1039d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1639,22 +1639,25 @@ static int rslms_is_meas_rep(struct msgb *msg)
static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len)
{
struct msgb *msg;
+ uint8_t meas_res[16];
uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
+ int res_valid = lchan->meas.flags & LC_UL_M_F_RES_VALID;
- LOGP(DRSL, LOGL_NOTICE, "%s Tx MEAS RES\n", gsm_lchan_name(lchan));
+ LOGP(DRSL, LOGL_NOTICE, "%s Tx MEAS RES valid(%d)\n",
+ gsm_lchan_name(lchan), res_valid);
+
+ if (!res_valid)
+ return -EINPROGRESS;
msg = rsl_msgb_alloc(sizeof(struct abis_rsl_dchan_hdr));
if (!msg)
return -ENOMEM;
msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++);
- if (lchan->meas.flags & LC_UL_M_F_RES_VALID) {
- uint8_t meas_res[16];
- int ie_len = lchan_build_rsl_ul_meas(lchan, meas_res);
- if (ie_len >= 3) {
- msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res);
- lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;
- }
+ int ie_len = lchan_build_rsl_ul_meas(lchan, meas_res);
+ if (ie_len >= 3) {
+ msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res);
+ lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;
}
msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {