summaryrefslogtreecommitdiff
path: root/test/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/shutdown.c')
-rw-r--r--test/shutdown.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/shutdown.c b/test/shutdown.c
index 5f4e9cc..5aa1371 100644
--- a/test/shutdown.c
+++ b/test/shutdown.c
@@ -32,6 +32,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));
@@ -40,7 +42,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));