Skip to content
Success

Changes

Summary

  1. osmo_io: Support rx of segments up to ~UINT16_MAX (details)
Commit c485733bcbbe974e4a06ac996dd29a9671a5a037 by Pau Espin Pedrol
osmo_io: Support rx of segments up to ~UINT16_MAX

Previously if we recevied a big chunk (near UINT16_MAX), we would hit
the following assert in iofd_msgb_alloc2(), because our msgb
implementation can only handle sizes up to 16 bit length, counting
headroom + data length:
"OSMO_ASSERT(size + headroom <= 0xffff);".

This new improved logic allows handling segments of up to ~UINT16_MAX
which may come in in multiple read calls. It also adds logic to catch
received segments greater than UINT16_MAX (or buggy segment_cb or buggy
peer transmitting to us) and notifies the user of a broken stream
through read_cb() in that case.

test_segmentation_uint16_max() is added to osmo_io_test, which would
abort without this patch applied.

Related: SYS#7842
Change-Id: I8c11a7edbed2335ada40a1f93d081041974c3586
The file was modifiedtests/osmo_io/osmo_io_test.c
The file was modifiedtests/osmo_io/osmo_io_test.err
The file was modifiedtests/osmo_io/osmo_io_test.ok
The file was modifiedsrc/core/osmo_io.c