792: fix(791): wrong payload length of first IPv4 frag r=thvdveld a=thvdveld
The payload length of the first IPv4 fragment packet contained the length of the unfragmented packet. This was because the `repr` was a clone and not a mutable ref to `ip_repr`. This is now fixed.
We also didn't check that the full IP packet fits in the fragmentation buffer, which should contain the unfragmented emitted packet.
Fixes#791.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
The payload length of the first IPv4 fragment packet contained the
length of the unfragmented packet. This was because the `repr` was
a clone and not a mutable ref to `ip_repr`. This is now fixed.
We also didn't check that the full IP packet fits in the fragmentation
buffer, which should contain the unfragmented emitted packet.
Fixes#791.
Signed-off-by: Thibaut Vandervelden <thvdveld@vub.be>
787: IPv4: Don't discard from unspecified src addresses r=Dirbaio a=bjoernQ
IPv4 packets from `0.0.0.0` get discarded early. This makes it impossible to create a DHCP server.
Not sure if this is the right location or even the right approach for this fix.
Maybe there is also a way to make this work without modifying the code?
Co-authored-by: bjoernQ <bjoern.quentin@mobile-j.de>
781: IPv6 Extension Headers rewrite r=thvdveld a=thvdveld
I rewrote the IPv6 Extension Headers. All those headers have the `Next Header` and `Header Length` fields in common. These are now accessible using `Ipv6ExtHeader`. I removed the IPv6HopByHopOption, because this header only contains options, which can be accessed using the `Ipv6OptionsIterator`.
I also added tests for 6LoWPAN extension headers, routing header and hop-by-hop header), replacing #765 and #770 .
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
789: fix: make codecov informational r=thvdveld a=thvdveld
Adding the lines makes codecov informational. This should stop making the coverage report fail CI (hopefully).
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
784: fix: check length field of NDISC redirected head r=thvdveld a=thvdveld
If the length field indicates a lenght bigger than the actual data that it is carying, then the packet is just wrong. Emitting such a packet is also not allowed. We now also parse the IPv6 header in an NDISC redirected packet and check that the length is correct.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
If the length field indicates a lenght bigger than the actual data that
it is carying, then the packet is just wrong. Emitting such a packet is
also not allowed. We now also parse the IPv6 header in an NDISC
redirected packet and check that the length is correct.
Signed-off-by: Thibaut Vandervelden <thvdveld@vub.be>
776: Add file descriptor support for tuntap devices r=Dirbaio a=blechschmidt
Android exposes a file descriptor to a TUN interface through the [VpnService](https://developer.android.com/reference/android/net/VpnService) interface. This commit adds support for operating on such a file descriptor directly.
Co-authored-by: B. Blechschmidt <git@blechschmidt.io>
771: Use bash script in CI r=thvdveld a=thvdveld
Use a bash script in CI. The advantage of this is that we can run this script locally as well, and thus check if a PR would pass the checks or not locally.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
766: Add wire representation for the RPL protocol. r=thvdveld a=thvdveld
I'm splitting #627 into smaller PRs.
This PR adds the wire representation of the RPL protocol.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
764: Fix incorrect test packet r=thvdveld a=thvdveld
The packet had 0x12 for the length, which is not the same as the variable name suggests.
bors r+
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
745: Modify `hardware_addr` and `neighbor_cache` to be not `Option` r=Dirbaio a=thvdveld
Since `neighbor_cache` is now using `heapless::LinearMap` it doesn't need to be an `Option` any more.
It's also possible to just make the `hardware_address` not `Option`.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
748: tcp: do not count window updates as duplicate acks. r=Dirbaio a=Dirbaio
rfc 2581:
> The TCP sender SHOULD use the "fast retransmit" algorithm to detect
> and repair loss, based on incoming duplicate ACKs. The fast
> retransmit algorithm uses the arrival of 3 duplicate ACKs (4
> ***identical*** ACKs without the arrival of any other intervening packets)
> as an indication that a segment has been lost. After receiving 3
> duplicate ACKs, TCP performs a retransmission of what appears to be
> the missing segment, without waiting for the retransmission timer to
> expire.
This means they have to have the same seq, ack and win, and therefore they must not be window updates.
Co-authored-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
744: Add support for rebinding to DHCP implementation r=Dirbaio a=JarredAllen
The current DHCP implementation does not include the REBINDING state as detailed in the spec. I propose modifying the REBINDING state to send request packets until the REBINDING time begins, and then broadcast request packets once the REBINDING time begins.
I added assertions for broadcast request packets to the existing unit tests, which pass. I also validated on my setup that it sent a broadcast request at the T2 time my DHCP server sends. I think this should be sufficient validation, but I can provide more if requested.
There were a couple edge cases of the DHCP protocol pertaining to this change for which I couldn't find a specification in the standards. I documented the decisions I made in those cases, but I'm not attached to what I did (my setup hits none of them) so I can change it to something else if you prefer.
Co-authored-by: Jarred Allen <jarred@moveparallel.com>
763: Add opcode and flag enums to dns export r=Dirbaio a=wmcleish
Added opcode and flag enums to dns export. As it currently stands, user is not able to access the enums which are parameters to DnsPacket's "set_opcode" and "set_flags" functions. This change will allow the user to import and use those enums to set the packet contents. If there is a more elegant way to include them in DnsPacket instead of being their own imports, please suggest what changes can be made. Refer to [issue 762](https://github.com/smoltcp-rs/smoltcp/issues/762)
Edit: Sorry for commit spam, rustfmt not working locally for some reason.
Co-authored-by: Will McLeish <71392578+wmcleish@users.noreply.github.com>
759: Put IEEE802154 in separate iface module r=thvdveld a=thvdveld
And thus splitting IEEE802154 from 6LoWPAN.
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>
758: Better impls defmt for some structs r=Dirbaio a=thvdveld
Sometimes, the defmt implementation was not readable when debugging. I changed it such that the defmt implementation matches the Display implementation (which was more readable).
Co-authored-by: Thibaut Vandervelden <thvdveld@vub.be>