Commit 3fcafeed authored by Jeremy Soller's avatar Jeremy Soller

Update smolnetd

parent 4d537dbd
This diff is collapsed.
......@@ -27,8 +27,7 @@ default-features = false
features = ["release_max_level_off"]
[dependencies.smoltcp]
git = "https://github.com/m-labs/smoltcp.git"
rev = "682fc3078229a4fc06b5f021af058c45b9f3bc02"
version = "0.5"
default-features = false
features = ["std", "socket-raw", "proto-ipv4", "socket-udp", "socket-tcp", "socket-icmp"]
......
......@@ -179,7 +179,7 @@ impl<'a, 'b> SchemeSocket for IcmpSocket<'a, 'b> {
let icmp_payload = self.send(icmp_repr.buffer_len(), file.data.ip)
.map_err(|_| syscall::Error::new(syscall::EINVAL))?;
let mut icmp_packet = Icmpv4Packet::new(icmp_payload);
let mut icmp_packet = Icmpv4Packet::new_unchecked(icmp_payload);
//TODO: replace Default with actual caps
icmp_repr.emit(&mut icmp_packet, &Default::default());
Ok(Some(buf.len()))
......@@ -202,7 +202,7 @@ impl<'a, 'b> SchemeSocket for IcmpSocket<'a, 'b> {
) -> SyscallResult<Option<usize>> {
while self.can_recv() {
let (payload, _) = self.recv().expect("Can't recv icmp packet");
let icmp_packet = Icmpv4Packet::new(&payload);
let icmp_packet = Icmpv4Packet::new_unchecked(&payload);
//TODO: replace default with actual caps
let icmp_repr = Icmpv4Repr::parse(&icmp_packet, &Default::default()).unwrap();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment