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

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
Oliver Smith 2020-03-04 17:11:40 +01:00 committed by Harald Welte
parent 45ff1d2e62
commit da8e9c9d6b
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ class MnccSocket(MnccSocketBase):
'(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