Document valid port range.
Switch the port parameters to long, since Java int can't hold the
largest u32 value.
Throw an exception if out of range values are passed.
Also enforce the >= 1024 restriction in VS, just in case we start
using privileged vsock ports for something.
Use a port number > 2^31 in one of our tests just to make sure it
works.
BYPASS_INCLUSIVE_LANGUAGE_REASON='man' used to refer to the manual command.
Bug: 261037705
Test: atest MicrodroidTests
Change-Id: Icf22d9c2e746f300b184e66469fb6b62c574b6ff
diff --git a/tests/testapk/src/native/testbinary.cpp b/tests/testapk/src/native/testbinary.cpp
index 8a0019d..b6a7aa2 100644
--- a/tests/testapk/src/native/testbinary.cpp
+++ b/tests/testapk/src/native/testbinary.cpp
@@ -112,7 +112,7 @@
}
struct sockaddr_vm server_sa = (struct sockaddr_vm){
.svm_family = AF_VSOCK,
- .svm_port = BnTestService::ECHO_REVERSE_PORT,
+ .svm_port = static_cast<uint32_t>(BnTestService::ECHO_REVERSE_PORT),
.svm_cid = VMADDR_CID_ANY,
};
int ret = TEMP_FAILURE_RETRY(bind(server_fd, (struct sockaddr*)&server_sa, sizeof(server_sa)));