552: tcp: Reply with RST to ACKs with invalid ackno in SYN_SENT. r=Dirbaio a=Dirbaio
Should fixaramperes/onetun#17.
`@aramperes` could you check if this fixes the issue? Thank you!
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
549: wire: add From<Address> for ::std::net::IpAddr r=Dirbaio a=Dirbaio
Originally from #296
Co-authored-by: Marc-André Lureau <marcandre.lureau@redhat.com>
548: DHCP fixes r=Dirbaio a=Dirbaio
Several fixes, including one that fixes DHCP not working with some routers.
See individual commit messages for details.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
Reasons:
1. We were already accidentally not setting the BROADCAST flag due to it being the wrong bit (see previous commit).
2. Major OSes don't set it.
3. rfc1542 section 3.1.1 states it's discouraged, and the issue it's supposed to workaround doesn't apply to smoltcp.
Unfortunately, some client implementations are
unable to receive such unicast IP datagrams until they know their own
IP address
(..)
This addition to the protocol is a workaround for old host
implementations. Such implementations SHOULD be modified so
that they may receive unicast BOOTREPLY messages, thus making
use of this workaround unnecessary. In general, the use of
this mechanism is discouraged.
This fixes DHCP on Linksys WRT1900AC. With 0x0001, it would not reply to
DISCOVERs at all, probably because seeing an unknown reserved flag being set.
With 0x8000, it works fine.
547: Basic rand infrastructure. r=Dirbaio a=Dirbaio
See [previous discussion](https://github.com/smoltcp-rs/smoltcp/pull/465#pullrequestreview-774487285). Opening a separate PR so it can be discussed separately.
- Add `smoltcp::rand`.
- On `std` targets, `OsRng` is used by default.
- The user can supply a custom impl by enabling the `rand-custom-impl` Cargo feature and using the `rand_custom_impl!()` macro.
- Specifying a custom impl is mandatory when `std` is not enabled.
- Make TCP initial sequence numbers actually random.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
On `std` targets, `OsRng` is used by default. The user can supply a custom impl
by enabling the `rand-custom-impl` Cargo feature and using the `rand_custom_impl!()` macro.
Specifying a custom impl is mandatory when `std` is not enabled.
- Mirrors what Linux does, so will hopefully reduce problems in broken networks.
- it can actually increase performance: for small ARP caches, it'll reduce the
amount of entries that we're not going to use, increasing the chances of the
ones that we actually use to stay in the cache.
Fixes#537
On paper this looks great, and in a sane network it should work.
However the world out there is full of horribly broken, screwed up
networks, which *of course* ruin this.
I've seen a customer's network where the router is IP 192.168.1.1,
MAC addr xx:03. However, every 1 minute the router broadcasts some
"mikrotik discovery" UDP garbage with source IP 192.168.1.1, source MAC
addr xx:02 (one less!). This accidentally poisons smoltcp's ARP cache,
which then sends all traffic for the default gateway to xx:02, which
unsurprisingly blackholes it.
And, of course, the broadcast is every 1min and the ARP cache lifetime
is 1min. This means the cache is almsot all the time poisoned, and the
smoltcp device barely works. Fantastic.
Screw you mikrotik.
514: use micros in Instant and Duration r=Dirbaio a=qiujiangkun
This improves precision everywhere, especially pcap
https://github.com/smoltcp-rs/smoltcp/pull/513
Co-authored-by: qiujiangkun <qiujiangkun@foxmail.com>
538: TCP fuzz fixes r=Dirbaio a=Dirbaio
Fixes panics and hangs found by whole-stack fuzzing. See individual commit messages.
Will post the whole-stack fuzz target when it's fully clean.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>