Commit fcfdcc12 authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'dup_tcp_conditional' into 'master'

fix return statement of else block in dup function

See merge request !34
parents 6a9fa006 01b6f9b9
This diff is collapsed.
......@@ -27,7 +27,8 @@ default-features = false
features = ["release_max_level_off"]
[dependencies.smoltcp]
version = "0.5.0"
git = "https://github.com/m-labs/smoltcp.git"
rev = "682fc3078229a4fc06b5f021af058c45b9f3bc02"
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_unchecked(icmp_payload);
let mut icmp_packet = Icmpv4Packet::new(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_unchecked(&payload);
let icmp_packet = Icmpv4Packet::new(&payload);
//TODO: replace default with actual caps
let icmp_repr = Icmpv4Repr::parse(&icmp_packet, &Default::default()).unwrap();
......@@ -269,3 +269,4 @@ impl<'a, 'b> SchemeSocket for IcmpSocket<'a, 'b> {
}
}
}
......@@ -162,7 +162,7 @@ impl<'a> SchemeSocket for TcpSocket<'a> {
if tcp_handle.flags & syscall::O_NONBLOCK == syscall::O_NONBLOCK {
return Err(SyscallError::new(syscall::EAGAIN));
} else {
return Err(SyscallError::new(syscall::EAGAIN));
Ok(None);
}
}
trace!("TCP creating new listening socket");
......
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