Skip to contentSkip to conversation

RFC - compile iptables without O2

PATCH New Phil Oester 1 participant 1 message Sep 8, 2004 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RFC - compile iptables without O2

There is an ancient bug in bugzilla (#13) which says iptables should compile without 'O2'. Not sure why this is important, but the below patch makes it compile, and the resulting executable works.

Anyone comment on why these '#ifndef __OPTIMIZE' statements were added in the first place, and whether I'm missing something by simply removing them?

Phil

ip6tables.c +0 -8
diff -ru ipt-orig/ip6tables.c ipt-new/ip6tables.c
@@ -148,14 +148,6 @@
  * magic number of -1 */
 int line = -1;
 
-#ifndef __OPTIMIZE__
-struct ip6t_entry_target *
-ip6t_get_target(struct ip6t_entry *e)
-{
-	return (void *)e + e->target_offset;
-}
-#endif
-
 static struct option *opts = original_opts;
 static unsigned int global_option_offset = 0;
 
iptables.c +0 -8
diff -ru ipt-orig/iptables.c ipt-new/iptables.c
@@ -147,14 +147,6 @@
  * magic number of -1 */
 int line = -1;
 
-#ifndef __OPTIMIZE__
-struct ipt_entry_target *
-ipt_get_target(struct ipt_entry *e)
-{
-	return (void *)e + e->target_offset;
-}
-#endif
-
 static struct option *opts = original_opts;
 static unsigned int global_option_offset = 0;
 
libiptc/libiptc.c +0 -8
diff -ru ipt-orig/libiptc/libiptc.c ipt-new/libiptc/libiptc.c
@@ -27,14 +27,6 @@
 #define IPT_LIB_DIR "/usr/local/lib/iptables"
 #endif
 
-#ifndef __OPTIMIZE__
-STRUCT_ENTRY_TARGET *
-GET_TARGET(STRUCT_ENTRY *e)
-{
-	return (void *)e + e->target_offset;
-}
-#endif
-
 static int sockfd = -1;
 static void *iptc_fn = NULL;