mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
packet_stream: packets w/o payload are still valid
Packets whose data is stored within the Packet_descriptor itself but not as payload, .e.g Usb::Packet_descriptor, are valid packets after all. So loosen the packet valid check for zero-sized packets is reasonable. Fixes #3076.
This commit is contained in:
parent
6b35b9de00
commit
108034b050
@ -538,7 +538,7 @@ class Genode::Packet_stream_base
|
||||
|
||||
bool packet_valid(Packet_descriptor packet)
|
||||
{
|
||||
return (packet.offset() >= _bulk_buffer_offset
|
||||
return !packet.size() || (packet.offset() >= _bulk_buffer_offset
|
||||
&& packet.offset() < _bulk_buffer_offset + (Genode::off_t)_bulk_buffer_size
|
||||
&& packet.offset() + packet.size() <= _bulk_buffer_offset + _bulk_buffer_size);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user