Skip to content

Commit

Permalink
Merge pull request #48 from quartiq/deps-smoltcp-0.11
Browse files Browse the repository at this point in the history
deps smoltcp 0.11
  • Loading branch information
ryan-summers authored Mar 25, 2024
2 parents 58c4e84 + 5a65544 commit 3e3373e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

This document describes the changes to smoltcp-nal between releases.

# [Unreleased]

## Changed
* Updated to smoltcp 0.11

# [0.4.1] - 2023-08-22

## Added
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ embedded-nal = "0.7"
embedded-time = "0.12"

[dependencies.nanorand]
version = "0.6.1"
version = "0.7.0"
default-features = false
features = ["wyrand"]

[dependencies.smoltcp]
version = "0.10"
version = "0.11"
features = ["medium-ethernet", "proto-ipv6", "socket-tcp", "socket-dns", "socket-dhcpv4", "socket-udp"]
default-features = false

[dependencies.shared-bus]
version = "0.2.2"
version = "0.3.1"
optional = true

[features]
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

use core::convert::TryFrom;
pub use embedded_nal;
use nanorand::Rng;
use nanorand::{Rng, SeedableRng};
pub use smoltcp;

use embedded_nal::{TcpClientStack, UdpClientStack, UdpFullStack};
Expand Down Expand Up @@ -202,7 +202,10 @@ where
/// # Args
/// * `seed` - A seed of random data to use for randomizing local TCP port selection.
pub fn seed_random_port(&mut self, seed: &[u8]) {
self.rand.reseed(seed);
let mut s = [0; 8];
let n = seed.len().min(s.len());
s[..n].copy_from_slice(&seed[..n]);
self.rand.reseed(s);
}

/// Poll the network stack for potential updates.
Expand Down

0 comments on commit 3e3373e

Please sign in to comment.