From 762868a8eb51562b3cb279948e87d94ddde3b56e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 00:15:21 +0400 Subject: [PATCH] Bump smoltcp from 0.11.0 to 0.12.0 (#62) * Bump smoltcp from 0.11.0 to 0.12.0 Bumps [smoltcp](https://github.com/smoltcp-rs/smoltcp) from 0.11.0 to 0.12.0. - [Release notes](https://github.com/smoltcp-rs/smoltcp/releases) - [Changelog](https://github.com/smoltcp-rs/smoltcp/blob/main/CHANGELOG.md) - [Commits](https://github.com/smoltcp-rs/smoltcp/compare/v0.11.0...v0.12.0) --- updated-dependencies: - dependency-name: smoltcp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * smoltcp moved to core::net types for IP addresses --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nikolay Edigaryev --- Cargo.lock | 4 ++-- lib/dhcp_snooper.rs | 8 ++++---- lib/host.rs | 2 +- lib/proxy/vm.rs | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 698c4fe..e1844ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1584,9 +1584,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smoltcp" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1a996951e50b5971a2c8c0fa05a381480d70a933064245c4a223ddc87ccc97" +checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" dependencies = [ "bitflags 1.3.2", "byteorder", diff --git a/lib/dhcp_snooper.rs b/lib/dhcp_snooper.rs index 07c0e70..10ea36d 100644 --- a/lib/dhcp_snooper.rs +++ b/lib/dhcp_snooper.rs @@ -26,14 +26,14 @@ impl DhcpSnooper { }; let dns_ips = match message.opts().get(OptionCode::DomainNameServer) { - Some(DhcpOption::DomainNameServer(dns_ips)) => HashSet::from_iter( - dns_ips.iter().map(|dns_ip| Ipv4Address(dns_ip.octets())), - ), + Some(DhcpOption::DomainNameServer(dns_ips)) => { + HashSet::from_iter(dns_ips.iter().cloned()) + } _ => HashSet::new(), }; self.vm_lease = Some(Lease::new( - message.yiaddr().into(), + message.yiaddr(), Duration::from_secs(*lease_time as u64), dns_ips, )) diff --git a/lib/host.rs b/lib/host.rs index 1397e52..75a83fd 100644 --- a/lib/host.rs +++ b/lib/host.rs @@ -92,7 +92,7 @@ impl Host { interface, new_packets_rx, callback_can_continue_tx, - gateway_ip: gateway_ip.into(), + gateway_ip, max_packet_size, finalized: false, }) diff --git a/lib/proxy/vm.rs b/lib/proxy/vm.rs index c06abac..53c7530 100644 --- a/lib/proxy/vm.rs +++ b/lib/proxy/vm.rs @@ -48,7 +48,7 @@ impl Proxy<'_> { let source_protocol_addr = Ipv4Addr::from(source_protocol_addr); if let Some(lease) = self.dhcp_snooper.lease() { - if lease.valid_ip_source(source_protocol_addr.into()) { + if lease.valid_ip_source(source_protocol_addr) { return Some(()); } } else if source_protocol_addr.is_unspecified() { @@ -62,7 +62,7 @@ impl Proxy<'_> { // Have we learned the VM's IP from the DHCP snooping? if let Some(lease) = &self.dhcp_snooper.lease() { // If so, allow all global traffic - let dst_addr = Ipv4Addr::from(ipv4_pkt.dst_addr().0); + let dst_addr = ipv4_pkt.dst_addr(); let dst_is_global = ip_network::IpNetwork::from(dst_addr).is_global(); if lease.valid_ip_source(ipv4_pkt.src_addr()) && dst_is_global {