This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
lynxis lazus gerrit-no-reply at lists.osmocom.orglynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/21723 )
Change subject: gprs_ns2: on ns2_create_vc parse the tlv before using it
......................................................................
gprs_ns2: on ns2_create_vc parse the tlv before using it
reject_status_msg require a parsed tlv. Otherwise an
uninitialized tlv is passed.
Change-Id: I82cab518966b8b49c3522ff5f7b6f82d1027a526
---
M src/gb/gprs_ns2.c
1 file changed, 9 insertions(+), 9 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/21723/1
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index d90ba85..e668fe4 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -773,6 +773,15 @@
if (msg->len < sizeof(struct gprs_ns_hdr))
return GPRS_NS2_CS_ERROR;
+ rc = ns2_tlv_parse(&tp, nsh->data,
+ msgb_l2len(msg) - sizeof(*nsh), 0, 0);
+ if (rc < 0) {
+ LOGP(DLNS, LOGL_ERROR, "Rx NS RESET Error %d during "
+ "TLV Parse\n", rc);
+ /* TODO: send invalid message back */
+ return GPRS_NS2_CS_REJECTED;
+ }
+
switch (nsh->pdu_type) {
case NS_PDUT_STATUS:
/* Do not respond, see 3GPP TS 08.16, 7.5.1 */
@@ -813,15 +822,6 @@
return GPRS_NS2_CS_REJECTED;
}
- rc = ns2_tlv_parse(&tp, nsh->data,
- msgb_l2len(msg) - sizeof(*nsh), 0, 0);
- if (rc < 0) {
- LOGP(DLNS, LOGL_ERROR, "Rx NS RESET Error %d during "
- "TLV Parse\n", rc);
- /* TODO: send invalid message back */
- return GPRS_NS2_CS_REJECTED;
- }
-
if (!TLVP_PRES_LEN(&tp, NS_IE_CAUSE, 1) ||
!TLVP_PRES_LEN(&tp, NS_IE_VCI, 2) || !TLVP_PRES_LEN(&tp, NS_IE_NSEI, 2)) {
LOGP(DLNS, LOGL_ERROR, "NS RESET Missing mandatory IE\n");
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/21723
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I82cab518966b8b49c3522ff5f7b6f82d1027a526
Gerrit-Change-Number: 21723
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201215/4e1124fc/attachment.htm>