]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
Modify pernet_operations check
authorJozsef Kadlecsik <kadlec@netfilter.org>
Thu, 5 Jun 2025 07:15:47 +0000 (09:15 +0200)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Fri, 6 Jun 2025 09:51:42 +0000 (11:51 +0200)
Check for 'int \*id' in the pernet_operations struct
fails for some later versions of kernels as the declaration
is now 'int * const id'.

Kernel Commit 768e4bb6a75e3c6a034df7c67edac20bd222857e changed
the variable declaration that ipset uses to ensure presence
of the pernet ops id.

Modify the pattern match to include both the newer change while
still supporting the original declaration.

Reported and original patch submitted by Mike Pagano <mpagano@gentoo.org>,
single pattern suggested by Jeremy Sowden <jeremy@azazel.net>

Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
configure.ac

index b8e94333e9ae89ad2e8012d752e857d3858d9a52..f6e1c363c2340dba232ee0dfc6f9144ecb6207a9 100644 (file)
@@ -401,7 +401,7 @@ fi
 
 AC_MSG_CHECKING([kernel source for id in struct pernet_operations])
 if test -f $ksourcedir/include/net/net_namespace.h && \
-   $AWK '/^struct pernet_operations /,/^}/' $ksourcedir/include/net/net_namespace.h | $GREP -q 'int \*id;'; then
+   $AWK '/^struct pernet_operations /,/^}/' $ksourcedir/include/net/net_namespace.h | $GREP -qE 'int \*( const )?id;'; then
        AC_MSG_RESULT(yes)
        AC_SUBST(HAVE_NET_OPS_ID, define)
 else