Add options to WasiCtx for toggling TCP and UDP on and off#7647
Conversation
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
alexcrichton
left a comment
There was a problem hiding this comment.
Thanks! Mind adding a test for this as well?
If you're up for it too it'd be nice to get this hooked up to -S/--wasi options on the CLI, for example -S tcp would enable TCP connections while -S udp would enable UDP. (similarly -S tcp=n would disable TCP.
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
|
@alexcrichton I've addressed your feedback for everything but the test. Looking at the testing structure in wasmtime, I couldn't find a place where a test for this should clearly go. For example, I don't see a place where name lookups not being allowed is being tested. Any pointers on where to test this would be most appreciated. |
|
Ah yes that's a good point that name lookups not being allowed isn't tested right now. Since that was added it'd become easier to add tests though so I think the best way to test this would be something along the lines of a Alternatively a |
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
|
@alexcrichton I added a test for TCP - I will add a test in #7648 for UDP since those tests would fail without the fixes there. |
|
Help |
This adds options to
WasiCtxthat allow disabling TCP and UDP wholesale. For TCP this prevents usage of binding, connecting, listening, and accepting while for UDP it prevents binding.