]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Removes KERNEL_64_USERSPACE_32
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 30 Jun 2007 10:47:57 +0000 (10:47 +0000)
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Sat, 30 Jun 2007 10:47:57 +0000 (10:47 +0000)
The recent kernel has compat layer for iptables. It doesn't have
compat layer for libipq and ip6tables, but ip6tables with
KERNEL_64_USERSPACE_32 is still broken. We should fix kernel instead of
fixing them if and when we want use their 32bit binary with 64bit kernel.

Makefile
include/libipq/ip_queue_64.h [deleted file]
include/libipq/libipq.h
include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
include/linux/netfilter_ipv4/ipt_SAME.h
libiptc/libiptc.c

index df04d35a9f28186bf78a4acdaa6d3e5f30c08069..76d8e407b1278fef50aa754ccd8bcc54b44005cb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -59,39 +59,6 @@ EXTRAS_EXP+=ip6tables-save ip6tables-restore
 EXTRA_INSTALLS_EXP+=$(DESTDIR)$(BINDIR)/ip6tables-save $(DESTDIR)$(BINDIR)/ip6tables-restore # $(DESTDIR)$(MANDIR)/man8/iptables-restore.8 $(DESTDIR)$(MANDIR)/man8/iptables-save.8 $(DESTDIR)$(MANDIR)/man8/ip6tables-save.8 $(DESTDIR)$(MANDIR)/man8/ip6tables-restore.8
 endif
 
-# Sparc64 hack
-ifeq ($(shell uname -m),sparc64)
-       POINTERTEST:=1
-       32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__sparcv9) && !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit)
-       ifdef 32bituser
-               # The kernel is 64-bit, even though userspace is 32.
-               CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
-       else
-               EXT_LDFLAGS+=-Wl,-m,elf64_sparc
-       endif
-endif
-
-# Alpha only has 64bit userspace and fails the test below
-ifeq ($(shell uname -m), alpha)
-       POINTERTEST:=1
-endif
-
-# Generic test if arch wasn't found above
-ifneq ($(POINTERTEST),1)
-       # Try to determine if kernel is 64bit and we are compiling for 32bit
-       ifeq ($(shell [ -d $(KERNEL_DIR)/include/asm ] && echo YES), YES)
-               64bitkernel := $(shell echo -e "\#include <asm/types.h>\n\#if BITS_PER_LONG == 64\nkernel_is_64bits\n\#endif" | $(CC) $(CFLAGS) -D__KERNEL__ -E - | grep kernel_is_64bits)
-               ifdef 64bitkernel
-                       32bituser := $(shell echo -e "\#include <stdio.h>\n\#if !defined(__arch64__) && !defined(_LP64)\nuserspace_is_32bit\n\#endif" | $(CC) $(CFLAGS) -E - | grep userspace_is_32bit)
-                       ifdef 32bituser
-                               CFLAGS+=-DIPT_MIN_ALIGN=8 -DKERNEL_64_USERSPACE_32
-                       endif
-               endif
-       else
-               CFLAGS+=-D_UNKNOWN_KERNEL_POINTER_SIZE
-       endif
-endif
-
 ifndef IPT_LIBDIR
 IPT_LIBDIR:=$(LIBDIR)/iptables
 endif
diff --git a/include/libipq/ip_queue_64.h b/include/libipq/ip_queue_64.h
deleted file mode 100644 (file)
index b0c3222..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Redefine everything for a 64-bit kernel on 32-bit userspace */
-
-/* Based on ip_queue.h by (C) 2000 James Morris, this code is GPL. */
-#ifndef _IP_QUEUE_H
-#define _IP_QUEUE_H
-
-#include <net/if.h>
-#include <sys/types.h>
-
-/* Messages sent from kernel */
-typedef struct ipq_packet_msg {
-       u_int64_t packet_id;    /* ID of queued packet */
-       u_int64_t mark;         /* Netfilter mark value */
-       int64_t timestamp_sec;  /* Packet arrival time (seconds) */
-       int64_t timestamp_usec; /* Packet arrvial time (+useconds) */
-       unsigned int hook;              /* Netfilter hook we rode in on */
-       char indev_name[IFNAMSIZ];      /* Name of incoming interface */
-       char outdev_name[IFNAMSIZ];     /* Name of outgoing interface */
-       unsigned short hw_protocol;     /* Hardware protocol (network order) */
-       unsigned short hw_type;         /* Hardware type */
-       unsigned char hw_addrlen;       /* Hardware address length */
-       unsigned char hw_addr[8];       /* Hardware address */
-       u_int64_t data_len;             /* Length of packet data */
-       unsigned char payload[0];       /* Optional packet data */
-} ipq_packet_msg_t;
-
-/* Messages sent from userspace */
-typedef struct ipq_mode_msg {
-       unsigned char value;            /* Requested mode */
-       u_int64_t range;                /* Optional range of packet requested */
-} ipq_mode_msg_t;
-
-typedef struct ipq_verdict_msg {
-       unsigned int value;             /* Verdict to hand to netfilter */
-       u_int64_t id;           /* Packet ID for this verdict */
-       u_int64_t data_len;             /* Length of replacement data */
-       unsigned char payload[0];       /* Optional replacement packet */
-} ipq_verdict_msg_t;
-
-typedef struct ipq_peer_msg {
-       union {
-               ipq_verdict_msg_t verdict;
-               ipq_mode_msg_t mode;
-       } msg;
-} ipq_peer_msg_t;
-
-/* Packet delivery modes */
-enum {
-       IPQ_COPY_NONE,          /* Initial mode, packets are dropped */
-       IPQ_COPY_META,          /* Copy metadata */
-       IPQ_COPY_PACKET         /* Copy metadata + packet (range) */
-};
-#define IPQ_COPY_MAX IPQ_COPY_PACKET
-
-/* Types of messages */
-#define IPQM_BASE      0x10    /* standard netlink messages below this */
-#define IPQM_MODE      (IPQM_BASE + 1)         /* Mode request from peer */
-#define IPQM_VERDICT   (IPQM_BASE + 2)         /* Verdict from peer */ 
-#define IPQM_PACKET    (IPQM_BASE + 3)         /* Packet from kernel */
-#define IPQM_MAX       (IPQM_BASE + 4)
-
-#endif /*_IP_QUEUE_H*/
index f60fc4bda5bf55ef1bbcd5eec30ffb7a36ff6cdb..3cd1329217a00c48bfc4c8c978c8f94e8456d582 100644 (file)
 #include <asm/types.h>
 #include <linux/netlink.h>
 
-#ifdef KERNEL_64_USERSPACE_32
-#include "ip_queue_64.h"
-typedef u_int64_t ipq_id_t;
-#else
 #include <linux/netfilter_ipv4/ip_queue.h>
 typedef unsigned long ipq_id_t;
-#endif
 
 #ifdef DEBUG_LIBIPQ
 #include <stdio.h>
index 6f76060d3c825819c6bb047d03b9eaf57f1639e0..a8252ea590b0ca08bcf4d0714291f94e06a6cfb7 100644 (file)
@@ -27,11 +27,7 @@ struct ipt_clusterip_tgt_info {
        enum clusterip_hashmode hash_mode;
        u_int32_t hash_initval;
        
-#ifdef KERNEL_64_USERSPACE_32
-       u_int64_t config;
-#else
        struct clusterip_config *config;
-#endif
 };
 
 #endif /*_IPT_CLUSTERIP_H_target*/
index 89ba22fa5b0e33b1a91e6e5ebf408d7f848d41a2..cc4c0b2269afef65b364c077f88fb4842e4c76dd 100644 (file)
@@ -10,11 +10,7 @@ struct ipt_same_info
        unsigned char info;
        u_int32_t rangesize;
        u_int32_t ipnum;
-#ifdef KERNEL_64_USERSPACE_32
-       u_int64_t placeholder;
-#else
        u_int32_t *iparray;
-#endif
 
        /* hangs off end. */
        struct ip_nat_range range[IPT_SAME_MAX_RANGE];
index feb4379cc00b312064e1afd487d6b92ae91292dc..574cc0abf7b21dde38c6739424ec56c11d335253 100644 (file)
@@ -2170,22 +2170,6 @@ TC_COMMIT(TC_HANDLE_T *handle)
                }
        }
 
-
-#ifdef KERNEL_64_USERSPACE_32
-       {
-               /* Kernel will think that pointer should be 64-bits, and get
-                  padding.  So we accomodate here (assumption: alignment of
-                  `counters' is on 64-bit boundary). */
-               u_int64_t *kernptr = (u_int64_t *)&newcounters->counters;
-               if ((unsigned long)&newcounters->counters % 8 != 0) {
-                       fprintf(stderr,
-                               "counters alignment incorrect! Mail rusty!\n");
-                       abort();
-               }
-               *kernptr = newcounters->counters;
-       }
-#endif /* KERNEL_64_USERSPACE_32 */
-
 #ifdef IPTC_DEBUG2
        {
                int fd = open("/tmp/libiptc-so_set_add_counters.blob",