aboutsummaryrefslogtreecommitdiff
path: root/test/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/shutdown.c')
-rw-r--r--test/shutdown.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/shutdown.c b/test/shutdown.c
index 5aa1371..14c7407 100644
--- a/test/shutdown.c
+++ b/test/shutdown.c
@@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
+#include <string.h>
#include <assert.h>
#include <errno.h>
@@ -15,6 +16,7 @@
#include <sys/un.h>
#include <netinet/tcp.h>
#include <netinet/in.h>
+#include <arpa/inet.h>
#include "liburing.h"
@@ -42,8 +44,8 @@ int main(int argc, char *argv[])
assert(ret != -1);
addr.sin_family = AF_INET;
- addr.sin_port = (rand() % 61440) + 4096;
- addr.sin_addr.s_addr = 0x0100007fU;
+ addr.sin_port = htons((rand() % 61440) + 4096);
+ addr.sin_addr.s_addr = inet_addr("127.0.0.1");
ret = bind(recv_s0, (struct sockaddr*)&addr, sizeof(addr));
assert(ret != -1);