An incoming bytestream can be less than 24 bytes, leading to exceptions
when accessing its data (or allocating the vector for its payload).
Perform a size check before trying to decode the bytestream and discard
invalid incoming streams.
Signed-off-by: Francesco Valla <francesco.valla@mta.it>
This allows us to better implement alternative drivers
for devices, such as for device sharing servers or
talking to CoreMini processors within the same device.
This code previously was separately maintained in each of the
PCAP driver layers.
While adding complexity for reassembly, I decided it was
time to pull it out into a common implementation.
As of this commit, the old implementations have not been
removed from the PCAP drivers yet.