2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

test: static/socket-tcp -- Check if unshare successed

Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov
2018-09-19 14:50:33 +03:00
committed by Andrei Vagin
parent dbdd19fa1b
commit 1efdb547e2

View File

@@ -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"))