diff --git a/repos/os/src/server/nic_loopback/main.cc b/repos/os/src/server/nic_loopback/main.cc index 130ec9f21d..082fb93654 100644 --- a/repos/os/src/server/nic_loopback/main.cc +++ b/repos/os/src/server/nic_loopback/main.cc @@ -70,8 +70,6 @@ class Nic_loopback::Session_component : public Nic::Session_component void Nic_loopback::Session_component::_handle_packet_stream() { - size_t const alloc_size = Nic::Packet_allocator::DEFAULT_PACKET_SIZE; - /* loop while we can make progress */ for (;;) { @@ -111,7 +109,8 @@ void Nic_loopback::Session_component::_handle_packet_stream() Packet_descriptor packet_to_client; try { - packet_to_client = _rx.source()->alloc_packet(alloc_size); } + packet_to_client = _rx.source()->alloc_packet( + _tx.sink()->peek_packet().size()); } catch (Session::Rx::Source::Packet_alloc_failed) { continue; } diff --git a/repos/os/src/test/nic_loopback/main.cc b/repos/os/src/test/nic_loopback/main.cc index fef39d98e9..e0ffc1535e 100644 --- a/repos/os/src/test/nic_loopback/main.cc +++ b/repos/os/src/test/nic_loopback/main.cc @@ -195,9 +195,6 @@ struct Test::Roundtrip : Base if (rx_packet.size() != PACKET_SIZE) abort("sent and echoed packets differ in size"); - if (rx_packet.offset() != _expected_packet_offset) - abort(__func__, ": unexpected offset of received packet"); - /* compare original and echoed packets */ char const * const rx_content = nic.rx()->packet_content(rx_packet); for (unsigned i = 0; i < PACKET_SIZE; i++)