Commit Graph

1011 Commits

Author SHA1 Message Date
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
whitequark d5dd33cbe8 Merge pull request #420 from stabler/master
Make wire/ipv4 functions const where easy.
2021-02-15 20:26:29 +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 9d1e57efec Merge pull request #416 from smoltcp-rs/no-socket
Fix build when with no socket features
2021-02-01 19:17:11 +01:00
Dario Nieuwenhuis 857c012f14 Fix build when with no socket features 2021-02-01 16:45:32 +01:00
Dario Nieuwenhuis b143c5d69d Bump version, update repo URLs 2021-01-20 00:23:19 +01:00
Dario Nieuwenhuis c0f85435ba changelog: mention MSRV bump 2021-01-20 00:19:25 +01:00
Dario Nieuwenhuis f22ff8ad42 Link to PRs in changelog. 2021-01-20 00:17:40 +01:00
Dario Nieuwenhuis 371a03ad6f Add CHANGELOG.md 2021-01-20 00:14:15 +01:00
Dario Nieuwenhuis 8e30e064f0 Update README.md with now-supported features. 2021-01-19 23:28:48 +01:00
Dario Nieuwenhuis e027224b3d Merge pull request #413 from smoltcp-rs/simplify-lifetimes-2
Simplify more lifetimes
2021-01-19 23:06:34 +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
Dario Nieuwenhuis 84170c4556 Merge pull request #377 from MabezDev/subnet-local-broadcasts
Subnet broadcasts
2021-01-16 21:12:34 +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
Dario Nieuwenhuis db39ffd2ad Merge pull request #411 from crawford/non_exhaustive
Various cleanup
2021-01-16 01:32:28 +01: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
Dario Nieuwenhuis fbc006f622 Merge pull request #409 from niclashoyer/307_nonexhaustive
Use #[non_exhaustive] instead of manual variant
2021-01-09 02:09:20 +01:00
Niclas Hoyer ad7795f996 Use #[non_exhaustive] instead of manual variant 2021-01-09 02:06:00 +01:00
Dario Nieuwenhuis 47db8963df Merge pull request #410 from smoltcp-rs/simplify-lifetimes
Simplify Socket lifetimes
2021-01-09 02:04:03 +01:00
Dario Nieuwenhuis c09ca370b2 Simplify Socket lifetimes 2021-01-09 01:59:02 +01:00
Dario Nieuwenhuis f5f7037045 Remove unnecessary semicolon 2021-01-08 19:25:21 +01:00
Dario Nieuwenhuis 878c04250b Merge pull request #404 from smoltcp-rs/delayed-ack
tcp: add Delayed ACK
2021-01-07 00:26:01 +01:00
Dario Nieuwenhuis 2ea2b7ff6b tcp: add Delayed ACK 2021-01-07 00:21:55 +01:00
Dario Nieuwenhuis b803073ffb Merge pull request #407 from crawford/clippy
Pin clippy check to 1.49.0
2021-01-04 20:13:22 +01:00
Alex Crawford 1ca765230d Pin clippy check to 1.49.0
It can be rather surprising when new lints pop up when a new stable
toolchain is released. Let's pin this check to a specific version to
avoid those surprises.
2021-01-04 10:42:26 -08:00
Alex Crawford bcd78bbb1b Enable clippy on tests and examples
Might as well run the lints on our tests and examples. When I first
started doing this cleanup, I thought this was the default, but I must
have run `cargo clippy --all-targets` at some point in there.
2021-01-04 10:39:33 -08: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 ea4579d68a Clean up examples
These were flagged by `cargo clippy`:

    warning: you seem to be trying to use match for destructuring a
             single pattern. Consider using `if let`
    warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()`
             is equivalent
    warning: using `write!()` with a format string that ends in a single
             newline
    warning: useless conversion to the same type:
             `smoltcp::wire::Ipv4Address`
    warning: called `map(f)` on an `Option` value where `f` is a closure
             that returns the unit type `()`
    warning: returning the result of a `let` binding from a block
    warning: use of `unwrap_or` followed by a function call
2021-01-04 10:39:27 -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
Dario Nieuwenhuis 2d24b19195 Merge pull request #406 from smoltcp-rs/rto
tcp: Add RTT estimation.
2021-01-04 15:58:10 +01:00
Dario Nieuwenhuis bb891ce7c1 tcp: Add RTT estimation. 2021-01-04 03:26:55 +01:00
Dario Nieuwenhuis 0752945161 Make some time funcs const. 2021-01-04 01:37:06 +01:00
Dario Nieuwenhuis 890a95df4d Merge pull request #405 from smoltcp-rs/clippytest
clippy fixes
2021-01-04 01:22:24 +01:00
Dario Nieuwenhuis 45df367d7e More clippy fixes. 2021-01-04 01:19:20 +01:00
whitequark 039c6572c3 Merge pull request #403 from crawford/clippy
Last round of suggestions by clippy
2020-12-29 07:35:00 +00:00
Alex Crawford a7e6970103 Enforce that there are no warnings in clippy check 2020-12-28 23:31:17 -08:00
Alex Crawford bc957da1ea Collapse redundant closure
This was flagged by `cargo clippy`:

    warning: redundant closure found
2020-12-28 23:31:17 -08:00
Alex Crawford 039a55e1bf Remove unnecessary clones
These were flagged by `cargo clippy`:

    warning: using `clone` on a `Copy` type
2020-12-28 23:20:21 -08:00
Alex Crawford 33236f23f4 Remove an unneeded semicolon 2020-12-28 23:20:01 -08:00
Alex Crawford 0e21e8524f Silence warning about mapping to unit type
This was flagged by `cargo clippy`:

    warning: called `map(f)` on an `Option` value where `f` is a closure
             that returns the unit type `()`

I decided to disable this because it was suggesting changes like the
following and I prefer the original:

    @@ -1 +1 @@
    -self.waker.take().map(|w| w.wake());
    +if let Some(w) = self.waker.take() { w.wake() }
2020-12-28 23:10:05 -08:00