diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-05-27 11:09:06 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-05-29 19:55:30 +0000 |
commit | 05ba5c2a1039172b47860db85427cca6e78646bb (patch) | |
tree | f4a4c9e1ad64f4b170a71604acf10fcb687b165e /src/osmo-bts-trx | |
parent | 3f97e4b1fcdc788345ab7740bd4fb8a3d73f5526 (diff) |
Consistently check for minimum attribute/TLV length in RSL and OML
Make more use of TLVP_PRES_LEN() instead of plain TLVP_PRESENT() and
implicitly assuming a certain length of the information element.
What this obviously doesn't introduce is some kind of error
generation/reporting in case the minimum length is not fulfilled. An IE
that's too small is silently ignored by TLVP_PRES_LEN() and treated as
if the IE wouldn't exist in the first place.
Change-Id: If5c4eee65711c49bc8ba4675221b1d5fd16198e9
Diffstat (limited to 'src/osmo-bts-trx')
-rw-r--r-- | src/osmo-bts-trx/l1_if.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index f9ba5fa0..336ffaba 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -343,7 +343,7 @@ static uint8_t trx_set_bts(struct gsm_bts *bts, struct tlv_parsed *new_attr) uint8_t bsic = bts->bsic; struct gsm_bts_role_bts *btsb = bts_role_bts(bts); - if (TLVP_PRESENT(new_attr, NM_ATT_CONN_FAIL_CRIT)) { + if (TLVP_PRES_LEN(new_attr, NM_ATT_CONN_FAIL_CRIT, 1)) { const uint8_t *val = TLVP_VAL(new_attr, NM_ATT_CONN_FAIL_CRIT); btsb->radio_link_timeout = val[1]; } |