summaryrefslogtreecommitdiff
path: root/test/socket-rw.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket-rw.c')
-rw-r--r--test/socket-rw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/socket-rw.c b/test/socket-rw.c
index 77fae59..47ae25c 100644
--- a/test/socket-rw.c
+++ b/test/socket-rw.c
@@ -30,6 +30,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));
@@ -38,7 +40,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));