With the latest Wasmtime dev version, the following test:
async fn test_wrong_address_family(family: IpAddressFamily) {
let sock = UdpSocket::create(family).unwrap();
let addr = match family {
IpAddressFamily::Ipv4 => IpSocketAddress::localhost(IpAddressFamily::Ipv6, 0),
IpAddressFamily::Ipv6 => IpSocketAddress::localhost(IpAddressFamily::Ipv4, 0),
};
let result = sock.send(vec![0; 1], Some(addr)).await;
assert!(matches!(result, Err(ErrorCode::InvalidArgument)));
}
Passes on macOS, but fails on Ubuntu/Windows.
According to the spec: invalid-argument should be returned if the remote-address has the wrong address family. (EAFNOSUPPORT)
With the latest Wasmtime
devversion, the following test:Passes on macOS, but fails on Ubuntu/Windows.
According to the spec:
invalid-argumentshould be returned if theremote-addresshas the wrong address family. (EAFNOSUPPORT)