aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-02-06 16:11:04 +0100
committerfixeria <vyanitskiy@sysmocom.de>2021-02-07 03:40:32 +0000
commitbb044952517686fef364969661b32f9ebd6f0462 (patch)
tree1374c27d1575e96c897a45d11327b973376bc10b
parent187effa00d4f65a65fb55c2923e3a2c44de3302e (diff)
oml: use regular TLVP_PRES() in rx_oml_ipa_rsl_connect()
Both NM_ATT_IPACC_DST_IP and NM_ATT_IPACC_DST_IP_PORT are defined as TLV_TYPE_FIXED, and NM_ATT_IPACC_STREAM_ID is TLV_TYPE_TV, so the TLV parser already does check the length for us. Change-Id: I1e493e552bb22bb42bb196ce71214e28d23fd19e
-rw-r--r--src/common/oml.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index b1ae7b47..9886fe44 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1390,14 +1390,14 @@ static int rx_oml_ipa_rsl_connect(struct gsm_bts_trx *trx, struct msgb *msg,
uint8_t stream_id = 0;
- if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_DST_IP, 4))
+ if (TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP))
in.s_addr = tlvp_val32_unal(tp, NM_ATT_IPACC_DST_IP);
else
in.s_addr = htonl(get_signlink_remote_ip(oml_link));
- if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_DST_IP_PORT, 2))
+ if (TLVP_PRESENT(tp, NM_ATT_IPACC_DST_IP_PORT))
port = ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_DST_IP_PORT));
- if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_STREAM_ID, 1))
+ if (TLVP_PRESENT(tp, NM_ATT_IPACC_STREAM_ID))
stream_id = *TLVP_VAL(tp, NM_ATT_IPACC_STREAM_ID);
LOGP(DOML, LOGL_INFO, "%s: Rx IPA RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n",