summaryrefslogtreecommitdiff
path: root/test/socket-rw-eagain.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket-rw-eagain.c')
-rw-r--r--test/socket-rw-eagain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/socket-rw-eagain.c b/test/socket-rw-eagain.c
index e08f984..b6406d8 100644
--- a/test/socket-rw-eagain.c
+++ b/test/socket-rw-eagain.c
@@ -28,6 +28,8 @@ int main(int argc, char *argv[])
if (argc > 1)
return 0;
+ srand(getpid());
+
recv_s0 = socket(AF_INET, SOCK_STREAM | SOCK_CLOEXEC, IPPROTO_TCP);
ret = setsockopt(recv_s0, SOL_SOCKET, SO_REUSEPORT, &val, sizeof(val));
@@ -36,7 +38,7 @@ int main(int argc, char *argv[])
assert(ret != -1);
addr.sin_family = AF_INET;
- addr.sin_port = 0x1235;
+ addr.sin_port = (rand() % 61440) + 4096;
addr.sin_addr.s_addr = 0x0100007fU;
ret = bind(recv_s0, (struct sockaddr*)&addr, sizeof(addr));