diff --git a/criu/net.c b/criu/net.c index 936611de8..4215b8503 100644 --- a/criu/net.c +++ b/criu/net.c @@ -1541,13 +1541,18 @@ static inline int restore_iptables(int pid) struct cr_img *img; img = open_image(CR_FD_IPTABLES, O_RSTR, pid); - if (img) { - ret = run_iptables_tool("iptables-restore", img_raw_fd(img), -1); - close_image(img); + if (img == NULL) + return -1; + if (empty_image(img)) { + ret = 0; + goto ipt6; } + + ret = run_iptables_tool("iptables-restore", img_raw_fd(img), -1); + close_image(img); if (ret) return ret; - +ipt6: img = open_image(CR_FD_IP6TABLES, O_RSTR, pid); if (img == NULL) return -1;