Skip to contentSkip to conversation

lapi/ip_tables.h: Fix build on older distributions

PATCH New Cyril Hrubis 1 participant 1 message Aug 5, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lapi/ip_tables.h: Fix build on older distributions

On older distributions the linux/netfilter_ipv4/ip_tables.h does not include a header that would define IFNAMSIZ and the build fails.

This effectivelly moves the #include <net/if.h> from the setsockopt03.c to the lapi/ip_tables.h which fixes the build.

Fixes 5684bec6b480 (API: Add lapi/ip_tables.h and use it in setsockopt03)
---
 include/lapi/ip_tables.h                            | 1 +
 testcases/kernel/syscalls/setsockopt/setsockopt03.c | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
include/lapi/ip_tables.h +1 -0
index e91238ffd..3ac62141c 100644
@@ -5,6 +5,7 @@
 
 #include "config.h"
 
+#include <net/if.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 
 #ifndef HAVE_STRUCT_XT_ENTRY_MATCH
testcases/kernel/syscalls/setsockopt/setsockopt03.c +0 -1
index 1434475db..b7a4447ba 100644
@@ -19,7 +19,6 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
-#include <net/if.h>
 #include <limits.h>
 
 #include "tst_test.h"
Signature · 1 line
2.31.1