aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/linux_common.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/csource/linux_common.go')
-rw-r--r--pkg/csource/linux_common.go32
1 files changed, 28 insertions, 4 deletions
diff --git a/pkg/csource/linux_common.go b/pkg/csource/linux_common.go
index 2ceb0b9d4..8f293204f 100644
--- a/pkg/csource/linux_common.go
+++ b/pkg/csource/linux_common.go
@@ -2635,8 +2635,14 @@ static void checkpoint_arptables(void)
int fd;
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (fd == -1)
+ if (fd == -1) {
+ switch (errno) {
+ case EAFNOSUPPORT:
+ case ENOPROTOOPT:
+ return;
+ }
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
+ }
for (i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) {
struct arpt_table_desc* table = &arpt_tables[i];
strcpy(table->info.name, table->name);
@@ -2682,8 +2688,14 @@ static void reset_arptables()
int fd;
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (fd == -1)
+ if (fd == -1) {
+ switch (errno) {
+ case EAFNOSUPPORT:
+ case ENOPROTOOPT:
+ return;
+ }
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
+ }
for (i = 0; i < sizeof(arpt_tables) / sizeof(arpt_tables[0]); i++) {
struct arpt_table_desc* table = &arpt_tables[i];
if (table->info.valid_hooks == 0)
@@ -2735,8 +2747,14 @@ static void checkpoint_ebtables(void)
int fd;
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (fd == -1)
+ if (fd == -1) {
+ switch (errno) {
+ case EAFNOSUPPORT:
+ case ENOPROTOOPT:
+ return;
+ }
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
+ }
for (i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) {
struct ebt_table_desc* table = &ebt_tables[i];
strcpy(table->replace.name, table->name);
@@ -2771,8 +2789,14 @@ static void reset_ebtables()
int fd;
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (fd == -1)
+ if (fd == -1) {
+ switch (errno) {
+ case EAFNOSUPPORT:
+ case ENOPROTOOPT:
+ return;
+ }
fail("socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)");
+ }
for (i = 0; i < sizeof(ebt_tables) / sizeof(ebt_tables[0]); i++) {
struct ebt_table_desc* table = &ebt_tables[i];
if (table->replace.valid_hooks == 0)