From 1efdb547e24ddef17400bea44e1642a550dae8d5 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 19 Sep 2018 14:50:33 +0300 Subject: [PATCH] test: static/socket-tcp -- Check if unshare successed Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrei Vagin --- test/zdtm/static/socket-tcp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/zdtm/static/socket-tcp.c b/test/zdtm/static/socket-tcp.c index 6b30fc42d..1db5a4dd6 100644 --- a/test/zdtm/static/socket-tcp.c +++ b/test/zdtm/static/socket-tcp.c @@ -68,7 +68,10 @@ int main(int argc, char **argv) socklen_t optlen; #ifdef ZDTM_CONNTRACK - unshare(CLONE_NEWNET); + if (unshare(CLONE_NEWNET)) { + pr_perror("unshare"); + return 1; + } if (system("ip link set up dev lo")) return 1; if (system("iptables -w -A INPUT -i lo -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT"))