Closed manekinekko closed 4 months ago
I have only skimmed the JCO implementation so I could be wrong, but: my guess is that it has to with the fact that you cache the local address, but don't update it after a stream
call.
"connect"ing a socket updates the local binding. This is documented on the stream
method in udp.wit:
This function only changes the local socket configuration and does not generate any network traffic. On success, the
remote-address
of the socket is updated. Thelocal-address
may be updated as well, based on the best network path toremote-address
.
I can confirm that this is resolved in the JCO implementation now.
Hi. I am working on implementing wasi-sockets for jco. I'd like to make sure I understand this UDP test program correctly.
In
crates/test-programs/src/bin/preview2_udp_sample_application.rs:49
:We are checking the
remote_address
received from the remote socket matches theclient_addr
used in the bind call. However, whenclient
is bound tounspecified_addr
(0.0.0.0
), the resolvedremote_address
of the remote client ends up being127.0.0.1
(this is probably spec'ed out in an ietf rfc but I couldn't find which one).So, the test case is failing because of this:
Also, I tried patching the remote socket resolved address making sure it's
0.0.0.0
, which passes the test above, however this breaks thetest_udp_dual_stack_conversation:111
test case, because we cannot send a UDP packet to remote address which value is0.0.0.0
(triggering a -65 errno):Can you please help adding some clarity?
cc @badeend @pchickey @guybedford