You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are checking the remote_address received from the remote socket matches the client_addr used in the bind call. However, when client is bound to unspecified_addr (0.0.0.0), the resolved remote_address of the remote client ends up being 127.0.0.1 (this is probably spec'ed out in an ietf rfc but I couldn't find which one).
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 the test_udp_dual_stack_conversation:111 test case, because we cannot send a UDP packet to remote address which value is 0.0.0.0 (triggering a -65 errno):
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. The local-address may be updated as well, based on the best network path to remote-address.
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
The text was updated successfully, but these errors were encountered: