Skip to content

p3: Inconsistent behavior in sockets/udp send #12475

@saulecabrera

Description

@saulecabrera

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior in the current implementation that needs fixingwasiIssues pertaining to WASI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions