]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
build: attempt to fix building under Linux 2.4
authorJan Engelhardt <jengelh@medozas.de>
Fri, 24 Jun 2011 18:16:48 +0000 (20:16 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Fri, 24 Jun 2011 18:16:48 +0000 (20:16 +0200)
iptables no longer compiles for Linux 2.4 because it uses
linux/magic.h. This header and the PROC_SUPER_MAGIC macro are only for
Linux 2.6.

xtables.c:35:52: error: linux/magic.h: No such file or directory
xtables.c: In function 'proc_file_exists':
xtables.c:389: error: 'PROC_SUPER_MAGIC' undeclared (first use in
this function)
xtables.c:389: error: (Each undeclared identifier is reported only
once for each function it appears in.)

References: http://bugzilla.netfilter.org/show_bug.cgi?id=720
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
configure.ac
iptables/xtables.c

index b57f542dbcaf00c13e01fe52ba5ff078025fa9a4..6c90caaf5f9b698e092ba3c571b96992731576e8 100644 (file)
@@ -59,12 +59,10 @@ AC_SUBST([libiptc_LDFLAGS2])
 
 blacklist_modules="";
 
-AC_CHECK_HEADER([linux/dccp.h])
+AC_CHECK_HEADERS([linux/dccp.h linux/ip_vs.h linux/magic.h linux/proc_fs.h])
 if test "$ac_cv_header_linux_dccp_h" != "yes"; then
        blacklist_modules="$blacklist_modules dccp";
 fi;
-
-AC_CHECK_HEADER([linux/ip_vs.h])
 if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
        blacklist_modules="$blacklist_modules ipvs";
 fi;
index 00c7c0665cdf7cd14db24b518c18265a28a00330..c4b1c2a8e3d1382fd990e6ec7146ed3759edb860 100644 (file)
@@ -15,6 +15,7 @@
  *     along with this program; if not, write to the Free Software
  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
+#include "config.h"
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <arpa/inet.h>
-#include <linux/magic.h> /* for PROC_SUPER_MAGIC */
+#if defined(HAVE_LINUX_MAGIC_H)
+#      include <linux/magic.h> /* for PROC_SUPER_MAGIC */
+#elif defined(HAVE_LINUX_PROC_FS_H)
+#      include <linux/proc_fs.h>       /* Linux 2.4 */
+#endif
 
 #include <xtables.h>
 #include <limits.h> /* INT_MAX in ip_tables.h/ip6_tables.h */