Commit Graph

700 Commits

Author SHA1 Message Date
Anton Romanov 0974b3c6be map -> inspect 2021-06-24 18:18:26 +00:00
Anton Romanov 4c05c3a9b9 Make clippy happy 2021-06-23 19:35:48 +00:00
Anton Romanov 5211338f57 remove unwrap 2021-06-23 19:33:36 +00:00
Anton Romanov c07cbfea0e Get rid of vec 2021-06-23 18:33:32 +00:00
Anton Romanov d0a7921cf6 Emit dns servers in DHCPv4 repr. Fixes #504 2021-06-23 18:19:54 +00:00
Dario Nieuwenhuis 3baa5fd28f tcp: use nonzero initial sequence number. 2021-06-11 22:55:52 +02:00
Dario Nieuwenhuis 0e7f78f47d tcp: fix substract with overflow when receiving a SYNACK with unincremented ACK number. 2021-06-11 22:55:32 +02:00
Dario Nieuwenhuis 1b3344bc52 Fix "subtract sequence numbers with underflow" on remote window shrink.
Fixes #489
2021-06-11 22:54:42 +02:00
Dario Nieuwenhuis 3433523a7c Remove unused attribute. 2021-05-29 04:33:54 +02:00
Dario Nieuwenhuis e8fe034b61 Fix u32::MAX 2021-05-29 04:26:25 +02:00
Anton Romanov 6dca868aed Account for lease time, router and subnet options in DhcpRepr::buffer_len 2021-05-29 04:26:25 +02:00
Dario Nieuwenhuis a2302412e7 tcp: LastAck should only change to Closed on ack of fin.
Fixes #470
2021-05-29 04:26:15 +02:00
Dario Nieuwenhuis cefbed6e52 tcp rtte: fix "attempt to multiply with overflow". Fixes #468 2021-05-29 04:25:11 +02:00
Dario Nieuwenhuis b693333125 phy: fix FaultInjector returning a too big buffer when simulating a drop on tx 2021-05-29 04:24:41 +02:00
Dario Nieuwenhuis b7c589e371 dhcp: Clear expiration time on reset. 2021-05-29 04:22:53 +02:00
Dario Nieuwenhuis 4047b9f75a dhcp: always send parameter_request_list. Fixes #445. 2021-05-29 04:21:48 +02:00
Dario Nieuwenhuis c7861455e1 iface: check for ipv4 subnet broadcast addrs everywhere 2021-05-29 04:21:16 +02:00
Dario Nieuwenhuis 4e314089d6 Fix "leftover tokens" macro error 2021-03-25 03:21:54 +01:00
Dario Nieuwenhuis a6a28957b3 Fix feature-related compilation issues. 2021-03-25 03:21:54 +01:00
Dario Nieuwenhuis 99f318f86e Fix timeval in phy_wait for times greater than 1 second 2021-03-25 03:21:54 +01:00
Dario Nieuwenhuis 5967c9aa7e Remove support table from docs. Fixes #361
The table is no longer very informative since it's all "yes" now.
2021-03-25 03:21:54 +01:00
Ryan Summers 881123f849 Removing lease expiration on reset - the lease does not expire 2021-03-18 16:26:44 +01:00
Ryan Summers 2851a135df Adding parsing test with lease time 2021-03-12 17:36:43 +01:00
Ryan Summers 39c3e7ef1f Updating control logic 2021-03-12 17:28:00 +01:00
Ryan Summers c491962b3f Refactoring retry mechanism 2021-03-12 16:14:44 +01:00
Ryan Summers 647e27ed2b Adding DHCP lease management 2021-03-12 14:03:51 +01:00
whitequark b1db516b10 Enable all Linux `phy` components for Android as well.
Fixes #433.
2021-03-12 06:31:05 +00:00
whitequark 9f0213765c Simplify enum_with_unknown! macro. 2021-03-12 06:15:34 +00:00
Dario Nieuwenhuis 4933a0a19f Merge pull request #431 from dnadlinger/patch-2
socket/tcp: Fix missing ` in doc comment
2021-03-07 07:58:04 +01:00
David Nadlinger b5eca87885 socket/tcp: Fix missing ` in doc comment 2021-03-07 04:14:10 +00:00
David Nadlinger 3fb05f0857 socket/tcp: Fix is_active comment typo 2021-03-07 04:09:44 +00:00
Nathan K. Zhinn 4ac265fb46 Fix BPF header length on OpenBSD.
The actual header length may be larger than the bpf_hdr struct due to aligning:
37ecb4d066/sys/net/bpf.c (L1649)
8f02f2a044/bsd/net/bpf.c (L3580)

Tests are only valid for 32 and 64 bit architectures. I did not bother
guarding them with additional cfg flags.
2021-03-01 04:37:37 +00:00
Dario Nieuwenhuis 5388ef1f1d Merge pull request #419 from vkrasnov/vlad/solicit_dst
Ask for dst_addr in neighbor solicitation request
2021-02-20 13:03:47 +01:00
whitequark 9f51548f4d Merge pull request #421 from pk-j-xyz/openbsd-bpf
Fix bpf ffi and add OpenBSD bpf cfg
2021-02-18 01:30:12 +00:00
Nathan K. Zhinn 019653b0cf Fix bpf ffi and add OpenBSD bpf cfg
This fixes the ordering that was causing a dealloc before the FFI call
to libc open.
2021-02-17 15:11:56 +00:00
Ben Stabler 335099aa26 Silence clippy lint for const assert work-around, remove const where using features not yet stable in 1.40 2021-02-11 23:10:35 -08:00
Ben Stabler 851d26aaa6 Make wire/ipv4 functions const where possible. 2021-02-11 22:49:33 -08:00
Vlad Krasnov c6f7163638 Ask for dst_addr in neighbor solicitation request 2021-02-09 14:07:57 -05:00
Dario Nieuwenhuis 857c012f14 Fix build when with no socket features 2021-02-01 16:45:32 +01:00
Dario Nieuwenhuis 8da202ff7f Simplify EthernetInterface lifetimes. 2021-01-19 22:59:52 +01:00
Dario Nieuwenhuis 02a80a6000 Simplify SocketSet lifetimes 2021-01-19 22:45:15 +01:00
Dario Nieuwenhuis af2eb5a454 Clarify docs of DeviceCapabilities MTU. Fixes #392 2021-01-19 22:20:40 +01:00
Scott Mabin 47d27472b9 subnet_broadcasts
Adds `is_subnet_broadcast` to the ethernet interface which checks for
subnet broadcasts, which are discussed on page 8 in
https://tools.ietf.org/html/rfc917. The subnet broadcast addresses are
derived from the interfaces ipv4 addresses.
2021-01-16 15:36:27 +00:00
Alex Crawford 0cf0a7e386 Clean up clippy warnings about if-else blocks
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.
2021-01-10 14:30:31 -08:00
Alex Crawford 06d128ad22 Use #[non_exhaustive] on structs as well
This builds on 633e7c25, adding the #[non_exhaustive] attribute to
applicable struct definitions.
2021-01-10 13:54:29 -08:00
Niclas Hoyer ad7795f996 Use #[non_exhaustive] instead of manual variant 2021-01-09 02:06:00 +01:00
Dario Nieuwenhuis c09ca370b2 Simplify Socket lifetimes 2021-01-09 01:59:02 +01:00
Dario Nieuwenhuis 2ea2b7ff6b tcp: add Delayed ACK 2021-01-07 00:21:55 +01:00
Alex Crawford cb66f9f036 Allow DeviceCapabilities to be initialized
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.
2021-01-04 10:39:33 -08:00
Alex Crawford 6b524dc74d Various cleanups
These were flagged by `cargo clippy`:

    warning: using `clone` on a `Copy` type
    warning: passing a unit value to a function
    warning: redundant closure found
    warning: called `iter().cloned().collect()` on a slice to create a
             `Vec`. Calling `to_vec()` is both faster and more readable
2021-01-04 10:39:06 -08:00