laforge has uploaded this change for review.

View Change

MNCC data size check: allow trailing data

Verify is the parsed data is at least the size of the struct, not
exactly the size. Make it accept messages with additional data, like
the SDP information the TTCN-3 testsuite is sending since
Ic9568c8927507e161aadfad1a4d20aa896d8ae30.

This change makes the size checks consistent with the other size
checks in MNCC implementations such as osmo-sip-connector

Related: OS#4282
Related: osmo-sip-connector I522ce7f206932a816a64f03d916799c3215bb8c7
Change-Id: Ic8c24e6988ae2d3c4278c4adccae46e248c893b8
---
M mncc_sock.py
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/mncc-python refs/changes/57/30857/1
diff --git a/mncc_sock.py b/mncc_sock.py
index b2d0705..cb10449 100644
--- a/mncc_sock.py
+++ b/mncc_sock.py
@@ -142,7 +142,7 @@
'(0x%04x vs 0x%04x)\n' % (msg.version, mncc.MNCC_SOCK_VERSION))

# Match expected message sizes / offsets
- if (msg.mncc_size != ctypes.sizeof(mncc.gsm_mncc) or
+ if (msg.mncc_size < ctypes.sizeof(mncc.gsm_mncc) or
msg.data_frame_size != ctypes.sizeof(mncc.gsm_data_frame) or
msg.called_offset != mncc.gsm_mncc.called.offset or
msg.signal_offset != mncc.gsm_mncc.signal.offset or

To view, visit change 30857. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: Ic8c24e6988ae2d3c4278c4adccae46e248c893b8
Gerrit-Change-Number: 30857
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-CC: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange