1774 Commits

Author SHA1 Message Date
XOR-op
ffcb62e119 test(tcp): add coverage for remote_has_sack in SYN-SENT state 2024-09-22 17:50:38 -04:00
XOR-op
805eed8447 fix: internal sACK flag not updated for client socket 2024-09-21 23:56:26 -04:00
Dario Nieuwenhuis
d667a2a467
Merge pull request #993 from lrh2000/poll-result
Export `PollResult`
2024-09-19 10:36:45 +00:00
Ruihan Li
336e7e5935 Export PollResult 2024-09-19 13:13:19 +08:00
Thibaut Vandervelden
9cc06575ea
Merge pull request #992 from thvdveld/update-action-checkout
Update actions/checkout to v4
2024-09-18 07:09:56 +00:00
Thibaut Vandervelden
b94dd2dd88 Update actions/checkout to v4 2024-09-18 09:02:13 +02:00
Dario Nieuwenhuis
4a9ebe7da2
Merge pull request #991 from smoltcp-rs/ll-poll
iface: make poll() process all packets, add fine-grained poll functions.
2024-09-17 14:01:39 +00:00
Dario Nieuwenhuis
dd43c8f189 iface: make poll() process all packets, add fine-grained poll functions.
This makes `.poll()` behave the same as before #954. Users affected by DoS
concerns can use the finer-grained egress-only and single-packet-ingress-only fns.
2024-09-16 19:59:38 +02:00
Dario Nieuwenhuis
3acd511179 tests: use two queues for TestingDevice.
Currently TestingDevice is a loopback device, which causes problems if the iface transmits a packet then receives.
The packet gets looped back to the interface instead of being handled by the test code.

This commit changes TestingDevice to behave more like a "virtual wire" that communicates the
interface with the testing code, with one queue for each direction.
2024-09-16 19:59:35 +02:00
Dario Nieuwenhuis
469dccdbae
Merge pull request #988 from smoltcp-rs/multicast-refactor-features
multicast: use single Cargo feature for both ipv4 and ipv6.
2024-09-16 14:37:14 +00:00
Dario Nieuwenhuis
dee8975afd
Merge pull request #987 from thvdveld/fix-panic-when-dns
Don't panic if no valid source address is found for the DNS query
2024-09-16 14:36:22 +00:00
Thibaut Vandervelden
749d8c7711
Merge pull request #989 from smoltcp-rs/fix-benches
Fix bench, check benches in CI.
2024-09-16 12:52:14 +00:00
Dario Nieuwenhuis
00aa2b457c Fix bench, check it in CI. 2024-09-12 17:10:03 +02:00
Dario Nieuwenhuis
07f09911bc multicast: use single Cargo feature for both ipv4 and ipv6.
The multicast feature was somewhat broken before, there was no way to do IPv6-only multicast
since a lot of multicast code was gated behind `proto-igmp` which force-enables ipv4.

Solution:

- Added feature `multicast` which enables multicast for ipv4 and/or ipv6, whatever the user has enabled.
- Removed feature `proto-igmp`. IGMP support in `wire` is always built if ipv4 is enabled. This causes no bloat if unused, and the increase in compile time is negligible. `iface` only uses it if the `multicast` feature is enabled.
2024-09-12 17:03:32 +02:00
Thibaut Vandervelden
649bce4012
Merge pull request #985 from smoltcp-rs/multicast-no-device
iface: do not require device and timestamp for multicast join/leave.
2024-09-12 14:54:26 +00:00
Dario Nieuwenhuis
34b1fa505b iface: do not require device and timestamp for multicast join/leave.
Instead of eagerly sending the join/leave packet when the user calls join/leave,
we update internal state and send the packet when the interface is polled.

Advantages:
- If the device is exhausted, the packet gets sent later instead of just failing and returning an error to the user.
- Makes the API consistent with everything else in smoltcp: operations only update internal state, poll is what sends/receives packets.
- Enables wrappers to offer simpler APIs with less generics. See https://github.com/embassy-rs/embassy/pull/3329 for an example, which is my original motivation.
2024-09-12 15:53:33 +02:00
Thibaut Vandervelden
115fd06f03 No panic if no valid src addr for DNS query
Don't panic if there is no valid source address for the DNS query. The
state of the query is set to `Failed` instead and the query is
abandoned.
2024-09-12 14:52:10 +02:00
Dario Nieuwenhuis
8602c0140e
Merge pull request #986 from birdistheword96/main
Prevent Panic in DNS Socket by Truncating Server List
2024-09-12 10:56:18 +00:00
Jamie Bird
4739cc7fc6 Fix: Prevent panic in DNS Socket when server list exceeds max count
- Truncate the servers list to DNS_MAX_SERVER_COUNT to prevent panics.
- Ensure only the first `DNS_MAX_SERVER_COUNT` servers are used when constructing the `Socket`.
- This prevents overflow issues when the provided server list is larger than the allowed maximum.
2024-09-12 11:28:27 +01:00
Dario Nieuwenhuis
8025752013
Merge pull request #984 from thvdveld/use-own-src-address
Use own source address for ARP and NDISC Solicitations
2024-09-11 19:01:32 +00:00
Thibaut Vandervelden
c76f32fa6c Use own src address for ARP and NDISC Solicits
When looking up the destination link-layer address for a given
destination address, we need to send an ARP or ICMPv6 Neighbor
Solicitation if the destination link-layer address is not in the cache.

When transmitting an ARP or ICMPv6 Neighbor Solicitation packet, use the
source address of the interface instead of the source address of the
packet that is tried to be sent.

By using the source address of the interface, we are sure that a
response will be received on the same interface.
2024-09-11 11:11:01 +02:00
Dario Nieuwenhuis
bc22929a7d
Merge pull request #977 from smoltcp-rs/tcp-fin-partially-out-of-window
tcp: do not ignore fin if segment is partially outside the window.
2024-09-10 21:42:42 +00:00
Catherine
2edea78f66
Merge pull request #980 from thvdveld/update-license
Update license copyright holder
2024-08-30 19:47:39 +00:00
Thibaut Vandervelden
957a39000c Update license copyright holder
Update the copyright holder in the license file.
2024-08-30 09:43:40 +02:00
Thibaut Vandervelden
de2dfe1a0d
Merge pull request #976 from smoltcp-rs/multicast-single-map
multicast: use a single map for both ipv4 and ipv6.
2024-08-29 11:38:08 +00:00
Dario Nieuwenhuis
bde1a1ee6d tcp: do not ignore fin if segment is partially outside the window. 2024-08-21 00:44:10 +02:00
Dario Nieuwenhuis
4990fb979d multicast: use a single map for both ipv4 and ipv6. 2024-08-20 00:04:20 +02:00
Dario Nieuwenhuis
8e3ea5c7f0
Merge pull request #975 from sciguy16/feature/ip-v6-new-const
Make Address:v6() constructor const
2024-08-16 20:29:08 +00:00
David Young
485f29cccc Make Address:v6() constructor const 2024-08-16 21:23:22 +01:00
Dario Nieuwenhuis
dc08e0b42e
Merge pull request #974 from korken89/fix-alloc-required
`extern crate alloc` was added accidentally breaking downstream `no_std`
2024-08-11 21:00:04 +00:00
Emil Fresk
ee1a9e59ac extern crate alloc was added accidentally breaking downstream no_std 2024-08-11 13:40:35 +02:00
Catherine
30966f3371
Merge pull request #924 from lmbollen/rx-token-consume-mutability
Change mutability of `RxToken`'s `consume` argument.
2024-08-09 17:39:35 +00:00
Lucas Bollen
4055a19bc3 Change mutability of RxToken's consume argument.
This drops the requirement that we can mutate the receive buffer, which is not always te case.
2024-08-09 10:21:06 +02:00
Dario Nieuwenhuis
4ed4f2a62d
Merge pull request #968 from thvdveld/fix-test-feature-flag
Fix wrong feature flag for UDP broadcast test
2024-08-05 11:31:50 +00:00
Dario Nieuwenhuis
2d4dde7c92
Merge pull request #969 from thvdveld/fix-cfgs
Fix target-arch names and remove unknonwn fuzzing cfg warning
2024-08-05 11:31:07 +00:00
Dario Nieuwenhuis
8be46b9287
Merge pull request #966 from korken89/neighbor-cache-expiry-fix
Reset expiry of entries in the neighbor cache on packet reception
2024-08-05 11:24:41 +00:00
Thibaut Vandervelden
86e56ad162 Remove warning for fuzzing feature
The warning is added in 1.80.0, but can be disabled by updating the
Cargo.toml file.
2024-08-05 12:22:49 +02:00
Thibaut Vandervelden
94d7ab8e4d Remove unknown target-arch for TUNSETIFF syscalls
The endianness of the target architecture cannot be specified using
target_arch. The endianness can be specified using target_endian.

The target description for mipsel-unknown-linux-gnu is found here:
https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs
In this specification, the arch is set to "mips" and not "mipsel".
2024-08-05 12:02:15 +02:00
Thibaut Vandervelden
8f06109a4a Fix wrong feature flag for UDP broadcast test
The UDP broadcast test was using the wrong feature flag. This commit
fixes the feature flag to use the correct one.
This must have slipped through the cracks when I updated the tests to
use rstest.
2024-08-05 11:32:07 +02:00
Emil Fresk
8e97c95f23 Update default neighbor cache size to 8 entries 2024-08-05 11:28:23 +02:00
Emil Fresk
a11428dfc9 Updated based on dirbaio's comments
- Check for unicast destination
- Source IP matches cache
- Source hardware address matches cache
2024-08-02 15:45:47 +02:00
Emil Fresk
fd758773d8 Reset expiry of entries in the neighbor cache on packet reception 2024-08-02 11:37:47 +02:00
Catherine
53caf70f64
Merge pull request #954 from quartiq/issue/848/infinite-poll
Limiting the number of poll loops to prevent DoS events
2024-07-23 14:10:16 +00:00
Ryan Summers
8c2cef1996 Limiting the number of poll loops to prevent DoS events
Updating process loop to be defined by socket buffers when possible

Further changes after hardware testing

Fixing test

Adding CHANGELOG entry

Expanding comment after review

Update src/iface/interface/mod.rs

Co-authored-by: Catherine <whitequark@whitequark.org>

Removing redundant phrasing in comment

Updating verbiage to remove references to unsafe and safe
2024-07-23 12:28:28 +02:00
Catherine
7b125ef601
Merge pull request #952 from lrh2000/test-benchmark
Fix benchmark and update results
2024-07-13 05:01:00 +00:00
Catherine
0847643198
Merge pull request #935 from lrh2000/window-update
Don't delay ACKs for significant window updates
2024-07-13 05:00:05 +00:00
Ruihan Li
f7d39d72a1 Fix benchmark and update results 2024-07-13 02:46:52 +08:00
Ruihan Li
bfbff600ae Add the loopback_benchmark 2024-07-13 02:44:59 +08:00
Ruihan Li
fe179c9184 Don't delay ACKs for significant window updates 2024-07-13 02:11:30 +08:00
Thibaut Vandervelden
c937695d42
Merge pull request #950 from wetheredge/const-assert
Use `assert!()` to check `prefix_len` in `Ipv4Cidr::new`
2024-07-09 07:09:49 +00:00