Skip to content

Commit

Permalink
Bump smoltcp from 0.11.0 to 0.12.0 (#62)
Browse files Browse the repository at this point in the history
* 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](smoltcp-rs/smoltcp@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] <[email protected]>

* smoltcp moved to core::net types for IP addresses

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Nikolay Edigaryev <[email protected]>
  • Loading branch information
dependabot[bot] and edigaryev authored Dec 4, 2024
1 parent 95a3358 commit 762868a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions lib/dhcp_snooper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
))
Expand Down
2 changes: 1 addition & 1 deletion lib/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
4 changes: 2 additions & 2 deletions lib/proxy/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 {
Expand Down

0 comments on commit 762868a

Please sign in to comment.