From bf2018dd07bfcbc1a7bb593656e9818253920dae Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 20 Apr 2018 19:06:39 +0200 Subject: executor: don't fail when ipv6 is not enabled Check in checkpoint_iptables is not enough as reset_iptables will fail even if no tables enabled. Add similar check to reset_iptables. --- executor/common_linux.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'executor') diff --git a/executor/common_linux.h b/executor/common_linux.h index a3db677ad..0b1f5c72a 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1557,8 +1557,14 @@ static void reset_iptables(struct ipt_table_desc* tables, int num_tables, int fa int fd, i; fd = socket(family, SOCK_STREAM, IPPROTO_TCP); - if (fd == -1) + if (fd == -1) { + switch (errno) { + case EAFNOSUPPORT: + case ENOPROTOOPT: + return; + } fail("socket(%d, SOCK_STREAM, IPPROTO_TCP)", family); + } for (i = 0; i < num_tables; i++) { struct ipt_table_desc* table = &tables[i]; if (table->info.valid_hooks == 0) -- cgit mrf-deployment