563: Print log to stdout in test r=Dirbaio a=deantvv
Use simple [trick](https://github.com/rust-lang/log/issues/106) to allow print log to stdout in test
Co-authored-by: Dean Li <deantvv@gmail.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
This lint is in stable Rust now: https://github.com/rust-lang/rust/issues/43302.
These changes are noted according to code comment from @whitequark.
Some test cases and functions are altered due to changes of #[must_use].
Previous code had an `if` to force sending a packet when retransmitting.
When the remote window is zero this would cause an infinite loop of
sending empty packets, because the "retransmit" flag would never get cleared.
Remove the force-retransmit, and add an explicit check on `seq_to_transmit` for
pending SYNs because SYN retransmission relied on it.
Found with cargo-fuzz.
This causes an infinite loop of zero-length packets: when we have data
to send, it sends MSS-length packets until filling the window, which
is an infinte amount of packets because mss is zero.
Found with cargo-fuzz.
529: Fix typos in tcp docs r=Dirbaio a=david-sawatzke
Too few round brackets
530: tcp: fix delayed ack causing ack not to be sent after 3 packets. r=Dirbaio a=Dirbaio
Co-authored-by: david-sawatzke <david-sawatzke@users.noreply.github.com>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
DeviceCapabilities contains the `medium` field, so tests had to give it a value
even if it was unused. This is impossible to do with no `medium-*` enabled, because
it makes `Medium` uninhabited (empty enum).
This de-duplicates and (hopefully) simplifies a few if-else blocks. The
others were given an exception because I thought they were more readable
as is. I've verified that these changes don't result in larger binaries.
This was flagged by `cargo clippy`:
warning: field assignment outside of initializer for an instance
created with Default::default()
This changes the visibility of the dummy field to be public, but only to
the crate.