summaryrefslogtreecommitdiffstats
path: root/iptables/xtables.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-06-24 20:16:48 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-06-24 20:16:48 +0200
commit3c871010888e1479ef8fca2048485b979ec2661a (patch)
tree3fdeb43f3321ff04d2a2ca201326bb2fde0c6f62 /iptables/xtables.c
parent447ddfbfb3ed16ad0059f4559334670e9b9806ec (diff)
build: attempt to fix building under Linux 2.4
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>
Diffstat (limited to 'iptables/xtables.c')
-rw-r--r--iptables/xtables.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/iptables/xtables.c b/iptables/xtables.c
index 00c7c066..c4b1c2a8 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -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>
@@ -32,7 +33,11 @@
#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 */