Skip to contentSkip to conversation

iptables compilation on <=2.6.13

PATCH Applied Phil Oester 2 participants 2 messages Nov 23, 2005 – Nov 26, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables compilation on <=2.6.13

Iptables since at least 1.3.3 will not compile with kernels <= 2.6.13 due to addition of the goto target. Below patch corrects this, and closes bug #386.

Phil

iptables.c +2 -0
diff -ru ipt-orig/iptables.c ipt-new/iptables.c
@@ -1415,8 +1415,10 @@
 	if (format & FMT_NOTABLE)
 		fputs("  ", stdout);
 
+#ifdef IPT_F_GOTO
 	if(fw->ip.flags & IPT_F_GOTO)
 		printf("[goto] ");
+#endif
 
 	IPT_MATCH_ITERATE(fw, print_match, &fw->ip, format & FMT_NUMERIC);
 
iptables-save.c +4 -0
diff -ru ipt-orig/iptables-save.c ipt-new/iptables-save.c
@@ -197,7 +197,11 @@
 	/* Print target name */	
 	target_name = iptc_get_target(e, h);
 	if (target_name && (*target_name != '\0'))
+#ifdef IPT_F_GOTO
 		printf("-%c %s ", e->ip.flags & IPT_F_GOTO ? 'g' : 'j', target_name);
+#else
+		printf("-j %s ", target_name);
+#endif
 
 	/* Print targinfo part */
 	t = ipt_get_target((struct ipt_entry *)e);
#1 lore raw
Quoted 3 lines · Phil Oester

Iptables since at least 1.3.3 will not compile with kernels <= 2.6.13 due to addition of the goto target. Below patch corrects this, and closes bug #386.

Applied, thanks.