[Devel] [PATCH 2/2 criu] test: check ipv6 sockets which handle ipv4 connections

Andrei Vagin avagin at openvz.org
Thu Nov 2 01:03:18 MSK 2017


From: Andrei Vagin <avagin at virtuozzo.com>

A server socket is created with AF_INET6, but a client
socket is create with AF_INET.

Signed-off-by: Andrei Vagin <avagin at virtuozzo.com>
---
 test/zdtm/static/Makefile                      | 18 ++++++++++++++++++
 test/zdtm/static/socket-tcp-close-wait.c       |  9 +++++++--
 test/zdtm/static/socket-tcp-closed.c           |  9 +++++++--
 test/zdtm/static/socket-tcp-closing.c          |  9 +++++++--
 test/zdtm/static/socket-tcp-fin-wait1.c        |  9 +++++++--
 test/zdtm/static/socket-tcp-last-ack.desc      |  2 +-
 test/zdtm/static/socket-tcp-reseted.c          | 10 +++++++---
 test/zdtm/static/socket-tcp-syn-sent.c         |  9 +++++++--
 test/zdtm/static/socket-tcp-unconn.c           |  9 +++++++--
 test/zdtm/static/socket-tcp.c                  |  9 +++++++--
 test/zdtm/static/socket-tcp4v6-close-wait.c    |  1 +
 test/zdtm/static/socket-tcp4v6-close-wait.desc |  1 +
 test/zdtm/static/socket-tcp4v6-closed.c        |  1 +
 test/zdtm/static/socket-tcp4v6-closed.desc     |  1 +
 test/zdtm/static/socket-tcp4v6-closing.c       |  1 +
 test/zdtm/static/socket-tcp4v6-closing.desc    |  1 +
 test/zdtm/static/socket-tcp4v6-fin-wait1.c     |  1 +
 test/zdtm/static/socket-tcp4v6-fin-wait1.desc  |  1 +
 test/zdtm/static/socket-tcp4v6-fin-wait2.c     |  1 +
 test/zdtm/static/socket-tcp4v6-fin-wait2.desc  |  1 +
 test/zdtm/static/socket-tcp4v6-last-ack.c      |  1 +
 test/zdtm/static/socket-tcp4v6-last-ack.desc   |  1 +
 test/zdtm/static/socket-tcp4v6-local.c         |  1 +
 test/zdtm/static/socket-tcp4v6-local.desc      |  1 +
 test/zdtm/static/socket-tcp4v6.c               |  1 +
 test/zdtm/static/socket-tcp4v6.desc            |  1 +
 test/zdtm/static/socket_listen.c               |  9 +++++++--
 test/zdtm/static/socket_listen4v6.c            |  1 +
 28 files changed, 99 insertions(+), 20 deletions(-)
 create mode 120000 test/zdtm/static/socket-tcp4v6-close-wait.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-close-wait.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-closed.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-closed.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-closing.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-closing.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-fin-wait1.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-fin-wait1.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-fin-wait2.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-fin-wait2.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-last-ack.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-last-ack.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6-local.c
 create mode 120000 test/zdtm/static/socket-tcp4v6-local.desc
 create mode 120000 test/zdtm/static/socket-tcp4v6.c
 create mode 120000 test/zdtm/static/socket-tcp4v6.desc
 create mode 120000 test/zdtm/static/socket_listen4v6.c

diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index 4afe51cb5..97c97a273 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -26,6 +26,7 @@ TST_NOFILE	:=				\
 		sched_policy00			\
 		socket_listen			\
 		socket_listen6			\
+		socket_listen4v6		\
 		socket_udp			\
 		socket6_udp			\
 		socket_udp_shutdown		\
@@ -65,26 +66,34 @@ TST_NOFILE	:=				\
 		socket-tcp			\
 		socket-tcp-reseted		\
 		socket-tcp6			\
+		socket-tcp4v6			\
 		socket-tcp-local		\
 		socket-tcp-nfconntrack		\
 		socket-tcp6-local		\
+		socket-tcp4v6-local		\
 		socket-tcpbuf			\
 		socket-tcpbuf-local		\
 		socket-tcpbuf6-local		\
 		socket-tcpbuf6			\
 		socket-tcp-fin-wait1		\
 		socket-tcp6-fin-wait1		\
+		socket-tcp4v6-fin-wait1		\
 		socket-tcp-fin-wait2		\
 		socket-tcp6-fin-wait2		\
+		socket-tcp4v6-fin-wait2		\
 		socket-tcp-close-wait		\
 		socket-tcp6-close-wait		\
+		socket-tcp4v6-close-wait		\
 		socket-tcp-last-ack		\
 		socket-tcp6-last-ack		\
+		socket-tcp4v6-last-ack		\
 		socket-tcp-closing		\
 		socket-tcp6-closing		\
+		socket-tcp4v6-closing		\
 		socket-tcp-closed		\
 		socket-tcp-closed-last-ack	\
 		socket-tcp6-closed		\
+		socket-tcp4v6-closed		\
 		socket-tcp-close0 		\
 		socket-tcp-close1 		\
 		socket-tcp-unconn		\
@@ -451,14 +460,18 @@ sem:			CFLAGS += -DNEW_IPC_NS
 posix_timers:		LDLIBS += -lrt -pthread
 remap_dead_pid_root:	CFLAGS += -DREMAP_PID_ROOT
 socket-tcp6:		CFLAGS += -D ZDTM_IPV6
+socket-tcp4v6:		CFLAGS += -D ZDTM_IPV4V6
 socket-tcpbuf6:		CFLAGS += -D ZDTM_IPV6
 socket-tcpbuf-local:	CFLAGS += -D ZDTM_TCP_LOCAL
 socket-tcpbuf6-local:	CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
 socket-tcp6-local:	CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV6
+socket-tcp4v6-local:	CFLAGS += -D ZDTM_TCP_LOCAL -D ZDTM_IPV4V6
 socket-tcp-local:	CFLAGS += -D ZDTM_TCP_LOCAL
 socket-tcp-nfconntrack: CFLAGS += -D ZDTM_TCP_LOCAL -DZDTM_CONNTRACK
 socket_listen6:		CFLAGS += -D ZDTM_IPV6
+socket_listen4v6:	CFLAGS += -D ZDTM_IPV4V6
 socket-tcp6-closed:	CFLAGS += -D ZDTM_IPV6
+socket-tcp6-closed:	CFLAGS += -D ZDTM_IPV4V6
 socket-tcp-closed-last-ack:	CFLAGS += -D ZDTM_TCP_LAST_ACK
 mnt_ext_manual:		CFLAGS += -D ZDTM_EXTMAP_MANUAL
 sigpending:		LDLIBS += -lrt
@@ -490,12 +503,17 @@ socket-tcp-fin-wait1:	CFLAGS += -D ZDTM_TCP_FIN_WAIT1
 socket-tcp-fin-wait2:	CFLAGS += -D ZDTM_TCP_FIN_WAIT2
 socket-tcp6-fin-wait1:	CFLAGS += -D ZDTM_TCP_FIN_WAIT1 -D ZDTM_IPV6
 socket-tcp6-fin-wait2:	CFLAGS += -D ZDTM_TCP_FIN_WAIT2 -D ZDTM_IPV6
+socket-tcp4v6-fin-wait1:	CFLAGS += -D ZDTM_TCP_FIN_WAIT1 -D ZDTM_IPV4V6
+socket-tcp4v6-fin-wait2:	CFLAGS += -D ZDTM_TCP_FIN_WAIT2 -D ZDTM_IPV4V6
 socket-tcp-close-wait:	CFLAGS += -D ZDTM_TCP_CLOSE_WAIT
 socket-tcp6-close-wait:	CFLAGS += -D ZDTM_TCP_CLOSE_WAIT -D ZDTM_IPV6
+socket-tcp4v6-close-wait:	CFLAGS += -D ZDTM_TCP_CLOSE_WAIT -D ZDTM_IPV4V6
 socket-tcp-last-ack:	CFLAGS += -D ZDTM_TCP_LAST_ACK
 socket-tcp6-last-ack:	CFLAGS += -D ZDTM_TCP_LAST_ACK -D ZDTM_IPV6
 socket-tcp6-closing:	CFLAGS += -D ZDTM_IPV6
 socket-tcp6-unconn:	CFLAGS += -D ZDTM_IPV6
+socket-tcp4v6-last-ack:	CFLAGS += -D ZDTM_TCP_LAST_ACK -D ZDTM_IPV4V6
+socket-tcp4v6-closing:	CFLAGS += -D ZDTM_IPV4V6
 
 pty-console:		CFLAGS += -D ZDTM_DEV_CONSOLE
 userns02:		CFLAGS += -D USERNS02
diff --git a/test/zdtm/static/socket-tcp-close-wait.c b/test/zdtm/static/socket-tcp-close-wait.c
index ff79c0cd7..3e3462bff 100644
--- a/test/zdtm/static/socket-tcp-close-wait.c
+++ b/test/zdtm/static/socket-tcp-close-wait.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check sockets in TCP_WAIT_STOP and TCP_LAST_ACK states\n";
@@ -186,7 +191,7 @@ int main(int argc, char **argv)
 	if (!newns)
 		test_init(argc, argv);
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-closed.c b/test/zdtm/static/socket-tcp-closed.c
index 2125b00be..0447e95b2 100644
--- a/test/zdtm/static/socket-tcp-closed.c
+++ b/test/zdtm/static/socket-tcp-closed.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check closed tcp sockets\n";
@@ -45,7 +50,7 @@ int main(int argc, char **argv)
 		return 1;
 	}
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-closing.c b/test/zdtm/static/socket-tcp-closing.c
index 14c9227d2..23d49cc86 100644
--- a/test/zdtm/static/socket-tcp-closing.c
+++ b/test/zdtm/static/socket-tcp-closing.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check sockets in the TCP_CLOSING state\n";
@@ -160,7 +165,7 @@ int main(int argc, char **argv)
 	if (!newns)
 		test_init(argc, argv);
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-fin-wait1.c b/test/zdtm/static/socket-tcp-fin-wait1.c
index f6d45c040..6c7cc93e5 100644
--- a/test/zdtm/static/socket-tcp-fin-wait1.c
+++ b/test/zdtm/static/socket-tcp-fin-wait1.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check sockets in TCP_FIN_WAIT* states\n";
@@ -159,7 +164,7 @@ int main(int argc, char **argv)
 	if (!newns)
 		test_init(argc, argv);
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-last-ack.desc b/test/zdtm/static/socket-tcp-last-ack.desc
index a0ff359ce..8cf84164e 100644
--- a/test/zdtm/static/socket-tcp-last-ack.desc
+++ b/test/zdtm/static/socket-tcp-last-ack.desc
@@ -1 +1 @@
-{'flavor': 'h', 'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'}
+{'flavor': 'h ns uns', 'opts': '--tcp-established', 'flags': 'nouser samens', 'feature' : 'tcp_half_closed'}
diff --git a/test/zdtm/static/socket-tcp-reseted.c b/test/zdtm/static/socket-tcp-reseted.c
index f5d1bfb92..ce52e1148 100644
--- a/test/zdtm/static/socket-tcp-reseted.c
+++ b/test/zdtm/static/socket-tcp-reseted.c
@@ -6,11 +6,15 @@
 #include <stdlib.h>
 #include <sys/wait.h>
 
-
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check, that a reseted TCP connection can be restored\n";
@@ -35,7 +39,7 @@ int main(int argc, char **argv)
 
 	test_init(argc, argv);
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-syn-sent.c b/test/zdtm/static/socket-tcp-syn-sent.c
index e68307e8c..cf4c3bb46 100644
--- a/test/zdtm/static/socket-tcp-syn-sent.c
+++ b/test/zdtm/static/socket-tcp-syn-sent.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check unconnected tcp sockets\n";
@@ -42,7 +47,7 @@ int main(int argc, char **argv)
 		return 1;
 	}
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp-unconn.c b/test/zdtm/static/socket-tcp-unconn.c
index 124a7330b..e943b7c7a 100644
--- a/test/zdtm/static/socket-tcp-unconn.c
+++ b/test/zdtm/static/socket-tcp-unconn.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check unconnected tcp sockets\n";
@@ -41,7 +46,7 @@ int main(int argc, char **argv)
 		return 1;
 	}
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp.c b/test/zdtm/static/socket-tcp.c
index 19dc53b85..6b30fc42d 100644
--- a/test/zdtm/static/socket-tcp.c
+++ b/test/zdtm/static/socket-tcp.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "Check, that a TCP connection can be restored\n";
@@ -135,7 +140,7 @@ int main(int argc, char **argv)
 	test_init(argc, argv);
 #endif
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket-tcp4v6-close-wait.c b/test/zdtm/static/socket-tcp4v6-close-wait.c
new file mode 120000
index 000000000..20d7e7898
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-close-wait.c
@@ -0,0 +1 @@
+socket-tcp-close-wait.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-close-wait.desc b/test/zdtm/static/socket-tcp4v6-close-wait.desc
new file mode 120000
index 000000000..c8cfe5e1f
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-close-wait.desc
@@ -0,0 +1 @@
+socket-tcp6-close-wait.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-closed.c b/test/zdtm/static/socket-tcp4v6-closed.c
new file mode 120000
index 000000000..b0c363c5c
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-closed.c
@@ -0,0 +1 @@
+socket-tcp-closed.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-closed.desc b/test/zdtm/static/socket-tcp4v6-closed.desc
new file mode 120000
index 000000000..9644990be
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-closed.desc
@@ -0,0 +1 @@
+socket-tcp6-closed.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-closing.c b/test/zdtm/static/socket-tcp4v6-closing.c
new file mode 120000
index 000000000..154ef8b8d
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-closing.c
@@ -0,0 +1 @@
+socket-tcp-closing.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-closing.desc b/test/zdtm/static/socket-tcp4v6-closing.desc
new file mode 120000
index 000000000..6981d0ada
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-closing.desc
@@ -0,0 +1 @@
+socket-tcp6-closing.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-fin-wait1.c b/test/zdtm/static/socket-tcp4v6-fin-wait1.c
new file mode 120000
index 000000000..2dede5f76
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-fin-wait1.c
@@ -0,0 +1 @@
+socket-tcp-fin-wait1.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-fin-wait1.desc b/test/zdtm/static/socket-tcp4v6-fin-wait1.desc
new file mode 120000
index 000000000..82ad86eae
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-fin-wait1.desc
@@ -0,0 +1 @@
+socket-tcp6-fin-wait1.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-fin-wait2.c b/test/zdtm/static/socket-tcp4v6-fin-wait2.c
new file mode 120000
index 000000000..a95fa079f
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-fin-wait2.c
@@ -0,0 +1 @@
+socket-tcp-fin-wait2.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-fin-wait2.desc b/test/zdtm/static/socket-tcp4v6-fin-wait2.desc
new file mode 120000
index 000000000..f393f96bf
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-fin-wait2.desc
@@ -0,0 +1 @@
+socket-tcp6-fin-wait2.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-last-ack.c b/test/zdtm/static/socket-tcp4v6-last-ack.c
new file mode 120000
index 000000000..1f0bedf9d
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-last-ack.c
@@ -0,0 +1 @@
+socket-tcp-last-ack.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-last-ack.desc b/test/zdtm/static/socket-tcp4v6-last-ack.desc
new file mode 120000
index 000000000..4b39f99e1
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-last-ack.desc
@@ -0,0 +1 @@
+socket-tcp6-last-ack.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-local.c b/test/zdtm/static/socket-tcp4v6-local.c
new file mode 120000
index 000000000..8cb60dd03
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-local.c
@@ -0,0 +1 @@
+socket-tcp.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6-local.desc b/test/zdtm/static/socket-tcp4v6-local.desc
new file mode 120000
index 000000000..ce647d040
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6-local.desc
@@ -0,0 +1 @@
+socket-tcp6-local.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6.c b/test/zdtm/static/socket-tcp4v6.c
new file mode 120000
index 000000000..8cb60dd03
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6.c
@@ -0,0 +1 @@
+socket-tcp.c
\ No newline at end of file
diff --git a/test/zdtm/static/socket-tcp4v6.desc b/test/zdtm/static/socket-tcp4v6.desc
new file mode 120000
index 000000000..094f5b898
--- /dev/null
+++ b/test/zdtm/static/socket-tcp4v6.desc
@@ -0,0 +1 @@
+socket-tcp6.desc
\ No newline at end of file
diff --git a/test/zdtm/static/socket_listen.c b/test/zdtm/static/socket_listen.c
index aae3c7993..d0acfd911 100644
--- a/test/zdtm/static/socket_listen.c
+++ b/test/zdtm/static/socket_listen.c
@@ -1,9 +1,14 @@
 #include "zdtmtst.h"
 
-#ifdef ZDTM_IPV6
+#ifdef ZDTM_IPV4V6
+#define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET6
+#elif defined(ZDTM_IPV6)
 #define ZDTM_FAMILY AF_INET6
+#define ZDTM_SRV_FAMILY AF_INET6
 #else
 #define ZDTM_FAMILY AF_INET
+#define ZDTM_SRV_FAMILY AF_INET
 #endif
 
 const char *test_doc = "static test for listening socket\n";
@@ -43,7 +48,7 @@ int main(int argc, char **argv)
 
 	test_init(argc, argv);
 
-	if ((fd_s = tcp_init_server(ZDTM_FAMILY, &port)) < 0) {
+	if ((fd_s = tcp_init_server(ZDTM_SRV_FAMILY, &port)) < 0) {
 		pr_err("initializing server failed\n");
 		return 1;
 	}
diff --git a/test/zdtm/static/socket_listen4v6.c b/test/zdtm/static/socket_listen4v6.c
new file mode 120000
index 000000000..d026b3bf8
--- /dev/null
+++ b/test/zdtm/static/socket_listen4v6.c
@@ -0,0 +1 @@
+socket_listen.c
\ No newline at end of file
-- 
2.13.6



More information about the Devel mailing list