laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/39247?usp=email )
(
2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: gprs_gmm_util: use a RAU specific TLV dictionary ......................................................................
gprs_gmm_util: use a RAU specific TLV dictionary
Limit the known and allowed TLVs according to the spec.
Change-Id: I460971deeebc9977a984937c542b263d941e78df --- M src/sgsn/gprs_gmm_util.c 1 file changed, 34 insertions(+), 2 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/sgsn/gprs_gmm_util.c b/src/sgsn/gprs_gmm_util.c index 01c94a7..b474a45 100644 --- a/src/sgsn/gprs_gmm_util.c +++ b/src/sgsn/gprs_gmm_util.c @@ -90,6 +90,38 @@ };
+ +const struct tlv_definition gsm48_gmm_rau_ie_tlvdef = { + .def = { + [GSM48_IE_GMM_PTMSI_SIG] = { TLV_TYPE_FIXED, 3 }, + [GSM48_IE_GMM_TIMER_READY] = { TLV_TYPE_TV, 1 }, + [GSM48_IE_GMM_DRX_PARAM] = { TLV_TYPE_FIXED, 2 }, + [GSM48_IE_GMM_TMSI_STATUS] = { TLV_TYPE_SINGLE_TV, 1 }, + [GSM48_IE_GMM_ALLOC_PTMSI] = { TLV_TYPE_TLV, 5 }, + [GSM48_IE_GMM_MS_NET_CAPA] = { TLV_TYPE_TLV, 2 }, + [GSM48_IE_GMM_PDP_CTX_STATUS] = { TLV_TYPE_TLV, 2 }, + [GSM48_IE_GMM_PS_LCS_CAPA] = { TLV_TYPE_TLV, 1 }, + [GSM48_IE_GMM_GMM_MBMS_CTX_ST] = { TLV_TYPE_TLV, 0 }, + [GSM48_IE_GMM_UE_NET_CAP] = { TLV_TYPE_TLV, 2 }, + [GSM48_IE_GMM_ADD_IDENTITY] = { TLV_TYPE_TLV, 0 }, + [GSM48_IE_GMM_RAI2] = { TLV_TYPE_TLV, 0 }, + [GSM48_IE_GMM_MS_CLASSMARK2] = { TLV_TYPE_TLV, 3 }, + [GSM48_IE_GMM_MS_CLASSMARK3] = { TLV_TYPE_TLV, 0 }, + [GSM48_IE_GMM_SUPP_CODEC_LIST] = { TLV_TYPE_TLV, 3 }, + [GSM48_IE_GMM_VD_PREF_UE_USAGE] = { TLV_TYPE_TLV, 1 }, + [GSM48_IE_GMM_PTMSI_TYPE] = { TLV_TYPE_SINGLE_TV, 1 }, + [GSM48_IE_GMM_DEVICE_PROP] = { TLV_TYPE_SINGLE_TV, 1 }, + [GSM48_IE_GMM_MS_NET_FEAT_SUP] = { TLV_TYPE_SINGLE_TV, 1 }, + [GSM48_IE_GMM_OLD_LAI] = { TLV_TYPE_TLV, 5 }, + [GSM48_IE_GMM_ADD_UPDATE_TYPE] = { TLV_TYPE_SINGLE_TV, 1 }, + [GSM48_IE_GMM_TMSI_BASED_NRI_C] = { TLV_TYPE_TLV, 4 }, + [GMM48_IE_GMM_TIMER_T3324] = { TLV_TYPE_TLV, 3 }, + [GSM48_IE_GMM_TIMER_T3312_EXT] = { TLV_TYPE_TLV, 3 }, + [GSM48_IE_GMM_EXT_DRX_PARAMS] = { TLV_TYPE_TLV, 3 }, + } +}; + + /*! Parse 24.008 9.4.1 Attach Request * \param[in] msg l3 pointers must point to gmm. * \param[out] rau_req parsed RA update request @@ -231,8 +263,8 @@ if (msgb_l3len(msg) == mandatory_fields_len) return 0;
- ret = tlv_parse(&rau_req->tlv, &gsm48_gmm_ie_tlvdef, - cur, msgb_l3len(msg) - mandatory_fields_len, 0, 0); + ret = tlv_parse(&rau_req->tlv, &gsm48_gmm_rau_ie_tlvdef, + cur, msgb_l3len(msg) - mandatory_fields_len, 0, 0);
if (ret < 0) return GMM_CAUSE_COND_IE_ERR;