1733 Commits

Author SHA1 Message Date
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
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
W Etheredge
bbc3001a90 Use assert!() to check prefix_len in Ipv4Cidr::new 2024-07-08 17:30:20 -05:00
Dario Nieuwenhuis
99ddd22cdb
Merge pull request #947 from umi-eng/duration-doc-typo
Fix typo in doc comment (`Instant` -> `Duration`)
2024-07-03 14:09:32 +00:00
Liam Kinne
5d6fd7e426 fix typo 2024-07-03 23:45:06 +10:00
Catherine
fcd40b536a
Merge pull request #946 from umi-eng/dhcp-event-clone
Add `Clone` trait to DHCP Event type
2024-07-03 11:00:23 +00:00
Liam Kinne
7604ea315b Add clone trait to dhcp event 2024-07-03 20:56:26 +10:00
Catherine
23697fa766
Merge pull request #939 from tomDev5/tcp_timestamp
Support TCP Timestamp option
2024-06-26 12:26:20 +00:00
TomDev5
89e82657af TCP Timestamp option support 2024-06-14 16:45:32 +03:00
Dario Nieuwenhuis
57b1dd4b15
Merge pull request #937 from umi-eng/core-net
Use `core` instead of `std` for net types.
2024-05-27 23:51:46 +00:00
Liam Kinne
10d91bfcf0 update msrv elsewhere 2024-05-28 09:32:52 +10:00
Liam Kinne
0d4062c0e5 add missing import 2024-05-27 23:36:59 +10:00
Liam Kinne
cbedd26910 avoid slow zero-filling initialization 2024-05-27 23:34:41 +10:00
Liam Kinne
50f5f17dca fix new clippy lints 2024-05-27 23:30:14 +10:00
Liam Kinne
a08021d1db change msrv to accommodate ip in core 2024-05-27 09:10:20 +10:00
Dario Nieuwenhuis
a2a0dfb2c3
Merge pull request #938 from umi-eng/lint/shorthand-struct-init
Lint: use shorthand struct initialization
2024-05-26 21:59:36 +00:00
Liam Kinne
0450ba3154 use shorthand struct initialization 2024-05-25 16:17:59 +10:00
Liam Kinne
5dc02c579e use core instead of std for net 2024-05-25 16:10:15 +10:00
Thibaut Vandervelden
30afc3eac2
Merge pull request #936 from umi-eng/nice-defmt-format-hardware-address
defmt Format hardware address the same as Display
2024-05-24 07:49:51 +00:00
Liam Kinne
1a597424b7 format the same as display 2024-05-24 14:56:25 +10:00
Thibaut Vandervelden
ef67e7b46c
Merge pull request #900 from thvdveld/ipv6-any-ip
fix: accept any ip for IPv6
2024-05-16 13:58:09 +00:00
Thibaut Vandervelden
35bb01afe3
Merge pull request #914 from lucasvr/lucas/multicastv6
Implement `join/leave_multicast_group()` for IPv6
2024-05-14 13:17:37 +00:00
Lucas Villa Real
20aa66bb21 rustfmt 2024-05-10 11:31:14 -03:00
Lucas Villa Real
d0fd2c8fc3 Update unit test 2024-05-10 11:29:48 -03:00
Lucas Villa Real
4d25db83c8 Address code review
- Split mldv2_router_alert() in two, adding a new function named
  push_padn_option(u8) to emit a PadN hop-by-hop option after any
  other options have been pushed already
- When emiting ReportRecordReprs, remove the conditional block
  that attempted to copy payload data over the destination record
2024-05-10 11:11:00 -03:00
Lucas Villa Real
db25ee4384 Address code review suggestions
- Handle payload copy outside of mld::AddressRecordRepr::emit()
- On unit test, use the parsed Hop-by-Hop option instead of checking
  that the wire representation of the two structures is the same
- Minor code changes
2024-05-02 12:46:14 -03:00
Lucas Villa Real
307952c13c Remove Ipv6NotSupported from enum MulticastError
No part of the code uses this anymore.
2024-04-19 14:51:49 -03:00
Thibaut Vandervelden
125773e282
Merge pull request #904 from chrysn-pull-requests/pktinfo
UDP: Store local and use local address in metadata
2024-04-19 12:49:48 +00:00
Lucas C. Villa Real
d52a196dcb Apply rustfmt on igmp.rs 2024-04-17 13:54:48 -03:00
Lucas C. Villa Real
cf1744a2d9 IPv6: implement leave_multicast_group()
Also, modify `test_join_ipv6_multicast_group()` so that it joins
the mDNS multicast group instead of 0xfe80::1. Because the lower 24
bits of 0xfe80::01 match the lower part of the IPv6 address assigned
to the test device by `crate::tests::setup()`, `has_multicast_group()`
would always returns `true`.
2024-04-17 13:40:37 -03:00
Dario Nieuwenhuis
d3ed3cc543
Merge pull request #920 from safarir/main
Typo fix in comment
2024-04-13 16:29:02 +00:00
Charles-Xavier Roy
3d69743edb Comment type fix 2024-04-13 10:22:51 -04:00
Dario Nieuwenhuis
f9c850b95a
Merge pull request #919 from skpupil/dev-checksum
ignore checksum during loopback
2024-04-10 15:35:31 +00:00
Dario Nieuwenhuis
114939aa99
Merge pull request #917 from copy/main
fix(tcp): only reset remote_last_ts if some data is enqueued
2024-04-08 12:11:15 +00:00
Fabian
18c131e885 fix(tcp): only reset remote_last_ts if some data is enqueued 2024-04-08 19:16:23 +08:00
skpupil
58f1f6fa28 ignore checksum during loopback 2024-04-07 19:32:11 +08:00
Lucas C. Villa Real
6c06cd9f8b Update PR #602: implement join_multicast_group() for IPv6
This patch rebases @jgallagher's to the tip of the main branch,
adding support for IPv6 multicast groups. As in the original PR,
it is only possible to join groups by sending an initial MLDv2
Report packet. It is not yet possible to resend the change report,
leave groups, respond to queries, etc.
2024-04-02 19:35:05 -03:00
Catherine
4c27918434
Merge pull request #907 from ytakano/main
feat(congestion control): add CongestionController trait and example impl
2024-03-11 07:48:09 +00:00
Yuuki Takano
833399f124
feat(socket/tcp): add congestion controllers
- add CongestionController trait
- implement Cubic and NoControl

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(socket/tcp): add congestion_controller.rs

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(cubic): add test for TCP Cubic

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(cubic): do not update congestion as much as possible

If the last update time of the cwnd was less than 100ms ago,
don't update the congestion window.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(cubic): implement slow start for TCP Cubic

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

fix(cubic): use MSS as the minimum cwnd

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

feat(tcp): add "socket-tcp-cubic" and "socket-tcp-reno" features

- "socket-tcp-cubic": use Cubic as a default congestion controller
- "socket-tcp-reno": use Reno as a default congestion controller

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

fix(tcp): prepare new() for Socket<'a, DefaultCC>

All tests are passed because of this fix.

$ cargo test
$ cargo test --features socket-tcp-cubic

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

feat(tcp, reno): add Reno of a congestion controller

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

feat(cubic): do not use cbrt() and powi() for no_std

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

fix(tcp): update for coverage test

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

fix(cubic): do not use `abs()` for no_std

Signed-off-by: Yuuki Takano <yuuki.takano@tier4.jp>

fix(tcp): make some types regading congestion control private

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): make `CongestionController` `pub(super)`

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): make modules of congestion controllers private

- `cubic`, `reno` and `no_control` modules are now private.
- `ActiveCC` is now `pub(super)`

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix: typo

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): use `defmt::Format` if `defmt` feature is specified

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): introduce `GenericController` for congestion control

Remove `socket-tcp-cubic` and `socket-tcp-reno` features
for congestion control.
Instead of the features, `set_congestion_control()`
is defined to set an algorithm of congestion control.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(tcp): add a test for `(set|get)_congestion_control()`

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix: restore unessesory change

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): rename congestion_controller to congestion

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): update the document about `Cubic`

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): do not use `Default` trait for congestion controller

Because `Default` trait requires `Size`,
returning `&dyn Trait` is rejected by the Rust compiler.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

chore(tcp): `#[allow(unused_variables)]` is moved on the trait

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(tcp): add `socket-tcp-cubic` feature for Cubic

Cubic uses f64 and it is inefficient on some platforms like STM32.
So, Cubic is disabled by default.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix: typo

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

Update src/socket/tcp.rs

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

feat(tcp): add `socket-tcp-reno` feature for Reno

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

feat(tcp): use GenericController::inner_*() methods

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): choose the best congestion controller

If Cubic is enabled, it is used as a default controller.
If Reno is enabled, it is used as a default controller.

If Cubic and Reno are eanabled, Cubic is a default controlerr,
but it can be specified by `set_congestion_control()` method.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): rename CongestionController to Controller

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): rename GenericController to AnyController

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): add a document to `AnyController::new()`

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>

fix(tcp): use Controller instead of CongestionController

CongestionController has been renamed.

Signed-off-by: Yuuki Takano <ytakanoster@gmail.com>
2024-03-11 16:31:53 +09:00
Dario Nieuwenhuis
ca909a2781
Merge pull request #905 from jlogan03/jlogan/update-dhcp-example
Update DHCP example
2024-02-10 01:57:21 +00:00
James Logan
1ff5bc41ee remove unused import 2024-02-09 20:39:32 -05:00
James Logan
b78ab0eb20 clear addresses instead of setting unspecified 2024-02-09 20:34:58 -05:00
James Logan
28b99014d9 update dhcp example to work in the case where we do not already have an ip address from some other source 2024-02-09 17:47:52 -05:00