aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/linux_common.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-04-20 19:06:39 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-04-20 20:14:10 +0200
commitbf2018dd07bfcbc1a7bb593656e9818253920dae (patch)
tree8fc72283f328a890dd0090c7c7ec34eb8a926ebc /pkg/csource/linux_common.go
parentcc402841ba1e067327a4adaf0a65335e47b5e83c (diff)
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.
Diffstat (limited to 'pkg/csource/linux_common.go')
-rw-r--r--pkg/csource/linux_common.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go
index 456ec4b90..ddacfb3ec 100644
--- a/pkg/csource/linux_common.go
+++ b/pkg/csource/linux_common.go
@@ -2574,8 +2574,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)