Re: [ANNOUNCE] ipset 7.8 released

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 4 Dec 2020, Ed W wrote:

> Hi, I'm having some difficulty compiling ipset 7.9 in kernel 4.14.78 as 
> provided by Variscite for an arm board
>  
> I've trimmed the build log and errors, but it seems to revolve around:
> 
> Pre kernel 4.18 the header
> 
>     ./include/linux/ipc.h
> 
> would include
> 
>     ./include/linux/rhashtable.h
> 
> (later it includes rhashtable-types.h)
> 
> This in turn draws in the jhash.c copy, which in turn includes 
> ip_set_compat.h, which then causes some errors due to drawing in things 
> where we haven't yet finished reading all the header files
> 
> I'm not sure how to work around the compile fail in ipset-7.9? I agree I 
> can't rule it out to be a problem due to the vendor kernel, but the 
> include tree seems to point clearly to the issue above in ipc.h 
> 
> 
> Note: ipset7.7 gives me errors about    
> 
>     error: 'fallthrough' undeclared
> 
> Which seems fair enough given the age of my kernel. I could probably fix this

That is fixed in 7.9.

> ipset 7.6 compiles ok for me.
>  
> Any guidance please?

Please give a try to the next patch on top of ipset 7.9: it separates the 
compiler compatibility stuff from the kernel compatibility part and that 
helps to resolve the include file issue.

diff --git a/.gitignore b/.gitignore
index 46a78dd..0e8a087 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@ Makefile.in
 Module.symvers
 modules.order
 kernel/include/linux/netfilter/ipset/ip_set_compat.h
+kernel/include/linux/netfilter/ipset/ip_set_compiler.h
 
 /aclocal.m4
 /autom4te.cache/
diff --git a/configure.ac b/configure.ac
index 1086de3..2f06590 100644
--- a/configure.ac
+++ b/configure.ac
@@ -851,7 +851,8 @@ dnl Checks for library functions.
 dnl Generate output
 AC_CONFIG_FILES([Makefile include/libipset/Makefile
 	lib/Makefile lib/libipset.pc src/Makefile utils/Makefile
-	kernel/include/linux/netfilter/ipset/ip_set_compat.h])
+	kernel/include/linux/netfilter/ipset/ip_set_compat.h
+	kernel/include/linux/netfilter/ipset/ip_set_compiler.h])
 AC_OUTPUT
 
 dnl Summary
diff --git a/kernel/include/linux/jhash.h b/kernel/include/linux/jhash.h
index 8df77ec..d144e33 100644
--- a/kernel/include/linux/jhash.h
+++ b/kernel/include/linux/jhash.h
@@ -1,6 +1,6 @@
 #ifndef _LINUX_JHASH_H
 #define _LINUX_JHASH_H
-#include <linux/netfilter/ipset/ip_set_compat.h>
+#include <linux/netfilter/ipset/ip_set_compiler.h>
 
 /* jhash.h: Jenkins hash support.
  *
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
index 8f00e6a..bf99bc0 100644
--- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
@@ -519,18 +519,5 @@ static inline void *kvzalloc(size_t size, gfp_t flags)
 	return members;
 }
 #endif
-
-/* Compiler attributes */
-#ifndef __has_attribute
-# define __has_attribute(x) __GCC4_has_attribute_##x
-# define __GCC4_has_attribute___fallthrough__		0
-#endif
-
-#if __has_attribute(__fallthrough__)
-# define fallthrough			__attribute__((__fallthrough__))
-#else
-# define fallthrough			do {} while (0)  /* fallthrough */
-#endif
-
 #endif /* IP_SET_COMPAT_HEADERS */
 #endif /* __IP_SET_COMPAT_H */
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compiler.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compiler.h.in
new file mode 100644
index 0000000..1b392f8
--- /dev/null
+++ b/kernel/include/linux/netfilter/ipset/ip_set_compiler.h.in
@@ -0,0 +1,15 @@
+#ifndef __IP_SET_COMPILER_H
+#define __IP_SET_COMPILER_H
+
+/* Compiler attributes */
+#ifndef __has_attribute
+# define __has_attribute(x) __GCC4_has_attribute_##x
+# define __GCC4_has_attribute___fallthrough__		0
+#endif
+
+#if __has_attribute(__fallthrough__)
+# define fallthrough			__attribute__((__fallthrough__))
+#else
+# define fallthrough			do {} while (0)  /* fallthrough */
+#endif
+#endif /* __IP_SET_COMPILER_H */
diff --git a/kernel/net/netfilter/ipset/ip_set_core.c b/kernel/net/netfilter/ipset/ip_set_core.c
index dcbc400..85961fc 100644
--- a/kernel/net/netfilter/ipset/ip_set_core.c
+++ b/kernel/net/netfilter/ipset/ip_set_core.c
@@ -21,6 +21,7 @@
 #include <linux/netfilter/x_tables.h>
 #include <linux/netfilter/nfnetlink.h>
 #include <linux/netfilter/ipset/ip_set.h>
+#include <linux/netfilter/ipset/ip_set_compiler.h>
 
 static LIST_HEAD(ip_set_type_list);		/* all registered set types */
 static DEFINE_MUTEX(ip_set_type_mutex);		/* protects ip_set_type_list */

Best regards,
Jozsef
-
E-mail  : kadlec@xxxxxxxxxxxxxxxxx, kadlecsik.jozsef@xxxxxxxxx
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
          H-1525 Budapest 114, POB. 49, Hungary

[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux