|
@@ -473,14 +473,14 @@ mod test {
|
|
|
{
|
|
|
let mut socket = ipv4_locals::socket(buffer(0), buffer(2));
|
|
|
|
|
|
- let mut wrong_version = ipv4_locals::PACKET_BYTES.clone();
|
|
|
+ let mut wrong_version = ipv4_locals::PACKET_BYTES;
|
|
|
Ipv4Packet::new_unchecked(&mut wrong_version).set_version(6);
|
|
|
|
|
|
assert_eq!(socket.send_slice(&wrong_version[..]), Ok(()));
|
|
|
assert_eq!(socket.dispatch(&checksum_caps, |_| unreachable!()),
|
|
|
Ok(()));
|
|
|
|
|
|
- let mut wrong_protocol = ipv4_locals::PACKET_BYTES.clone();
|
|
|
+ let mut wrong_protocol = ipv4_locals::PACKET_BYTES;
|
|
|
Ipv4Packet::new_unchecked(&mut wrong_protocol).set_protocol(IpProtocol::Tcp);
|
|
|
|
|
|
assert_eq!(socket.send_slice(&wrong_protocol[..]), Ok(()));
|
|
@@ -491,14 +491,14 @@ mod test {
|
|
|
{
|
|
|
let mut socket = ipv6_locals::socket(buffer(0), buffer(2));
|
|
|
|
|
|
- let mut wrong_version = ipv6_locals::PACKET_BYTES.clone();
|
|
|
+ let mut wrong_version = ipv6_locals::PACKET_BYTES;
|
|
|
Ipv6Packet::new_unchecked(&mut wrong_version[..]).set_version(4);
|
|
|
|
|
|
assert_eq!(socket.send_slice(&wrong_version[..]), Ok(()));
|
|
|
assert_eq!(socket.dispatch(&checksum_caps, |_| unreachable!()),
|
|
|
Ok(()));
|
|
|
|
|
|
- let mut wrong_protocol = ipv6_locals::PACKET_BYTES.clone();
|
|
|
+ let mut wrong_protocol = ipv6_locals::PACKET_BYTES;
|
|
|
Ipv6Packet::new_unchecked(&mut wrong_protocol[..]).set_next_header(IpProtocol::Tcp);
|
|
|
|
|
|
assert_eq!(socket.send_slice(&wrong_protocol[..]), Ok(()));
|
|
@@ -514,7 +514,7 @@ mod test {
|
|
|
let mut socket = ipv4_locals::socket(buffer(1), buffer(0));
|
|
|
assert!(!socket.can_recv());
|
|
|
|
|
|
- let mut cksumd_packet = ipv4_locals::PACKET_BYTES.clone();
|
|
|
+ let mut cksumd_packet = ipv4_locals::PACKET_BYTES;
|
|
|
Ipv4Packet::new_unchecked(&mut cksumd_packet).fill_checksum();
|
|
|
|
|
|
assert_eq!(socket.recv(), Err(Error::Exhausted));
|