Index: patches/iptables-1.3.7-do_multi-1.patch
===================================================================
--- patches/iptables-1.3.7-do_multi-1.patch	(revision 6d1c66edda01168eaf5ac5a59c8fe36482bf33a3)
+++ 	(revision )
@@ -1,79 +1,0 @@
-Submitted By: Jim Gifford <jciccone@linuxfromscratch.org>
-Date: 2007-02-05
-Initial Package Version: 1.3.7
-Origin: http://lists.netfilter.org/pipermail/netfilter-devel/2006-December/026344.html
-Upstream Status: Already Applied
-Description: Fixes Build Issues with DO_MULTI=1
-
-diff -Naur iptables-1.3.7.orig/Makefile iptables-1.3.7/Makefile
---- iptables-1.3.7.orig/Makefile	2006-12-04 03:16:01.000000000 -0800
-+++ iptables-1.3.7/Makefile	2007-02-05 10:57:33.000000000 -0800
-@@ -170,7 +170,7 @@
- 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LDLIBS)
- 
- ifeq ($(DO_MULTI), 1)
--$(DESTDIR)$(BINDIR)/iptables-xml: iptables-xml
-+$(DESTDIR)$(BINDIR)/iptables-xml: iptables
- 	@[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
- 	ln -sf $< $@
- else
-diff -Naur iptables-1.3.7.orig/iptables-multi.c iptables-1.3.7/iptables-multi.c
---- iptables-1.3.7.orig/iptables-multi.c	2006-12-04 03:15:20.000000000 -0800
-+++ iptables-1.3.7/iptables-multi.c	2007-02-05 10:55:22.000000000 -0800
-@@ -6,6 +6,7 @@
- int iptables_main(int argc, char **argv);
- int iptables_save_main(int argc, char **argv);
- int iptables_restore_main(int argc, char **argv);
-+int iptables_xml_main(int argc, char **argv);
- 
- int main(int argc, char **argv) {
-   char *progname;
-@@ -24,6 +25,8 @@
-     
-     if (!strcmp(progname, "iptables-restore"))
-       return iptables_restore_main(argc, argv);
-+    if (!strcmp(progname, "iptables-xml"))
-+      return iptables_restore_main(argc, argv);
-     
-     fprintf(stderr, "iptables multi-purpose version: unknown applet name %s\n", progname);
-     exit(1);
-diff -Naur iptables-1.3.7.orig/iptables-xml.c iptables-1.3.7/iptables-xml.c
---- iptables-1.3.7.orig/iptables-xml.c	2006-12-04 03:15:20.000000000 -0800
-+++ iptables-1.3.7/iptables-xml.c	2007-02-05 10:55:22.000000000 -0800
-@@ -26,8 +26,9 @@
- /* no need to link with iptables.o */
- const char *program_name;
- const char *program_version;
--int line = 0;
- 
-+#ifndef IPTABLES_MULTI
-+int line = 0;
- void
- exit_error(enum exittype status, char *msg, ...)
- {
-@@ -41,6 +42,7 @@
- 	/* On error paths, make sure that we don't leak memory */
- 	exit(status);
- }
-+#endif
- 
- static void print_usage(const char *name, const char *version)
- 	    __attribute__ ((noreturn));
-@@ -66,7 +68,7 @@
- 	exit(1);
- }
- 
--int
-+static int
- parse_counters(char *string, struct ipt_counters *ctr)
- {
- 	if (string != NULL)
-@@ -605,7 +607,7 @@
- 
- #ifdef IPTABLES_MULTI
- int
--iptables_restore_main(int argc, char *argv[])
-+iptables_xml_main(int argc, char *argv[])
- #else
- int
- main(int argc, char *argv[])
Index: patches/iptables-1.4.2-fixes-1.patch
===================================================================
--- patches/iptables-1.4.2-fixes-1.patch	(revision 6a3c6dcbdfe453cc6816551f5989f5f6c570d0b6)
+++ patches/iptables-1.4.2-fixes-1.patch	(revision 6a3c6dcbdfe453cc6816551f5989f5f6c570d0b6)
@@ -0,0 +1,133 @@
+Submitted By: Jim Gifford (jim at cross-lfs dot org)
+Date: 01-26-2009
+Initial Package Version: 1.4.2
+Origin: Upstream
+Upstream Status: Applied
+Description: This patch fixed issues that have been resolved in the current iptables tree.
+
+diff -Naur iptables-1.4.2.orig/extensions/libxt_hashlimit.c iptables-1.4.2/extensions/libxt_hashlimit.c
+--- iptables-1.4.2.orig/extensions/libxt_hashlimit.c	2008-10-08 09:31:58.000000000 -0700
++++ iptables-1.4.2/extensions/libxt_hashlimit.c	2009-01-26 14:56:10.367249615 -0800
+@@ -636,7 +636,7 @@
+ 	if (info->cfg.max != 0)
+ 		printf("--hashlimit-htable-max %u ", info->cfg.max);
+ 	if (info->cfg.gc_interval != XT_HASHLIMIT_GCINTERVAL)
+-		printf("--hashlimit-htable-gcinterval %u", info->cfg.gc_interval);
++		printf("--hashlimit-htable-gcinterval %u ", info->cfg.gc_interval);
+ 	if (info->cfg.expire != XT_HASHLIMIT_EXPIRE)
+ 		printf("--hashlimit-htable-expire %u ", info->cfg.expire);
+ 
+diff -Naur iptables-1.4.2.orig/extensions/libxt_iprange.c iptables-1.4.2/extensions/libxt_iprange.c
+--- iptables-1.4.2.orig/extensions/libxt_iprange.c	2008-10-08 09:31:58.000000000 -0700
++++ iptables-1.4.2/extensions/libxt_iprange.c	2009-01-26 14:58:09.455715602 -0800
+@@ -5,6 +5,7 @@
+ #include <stdlib.h>
+ #include <getopt.h>
+ 
++#include <netinet/in.h>
+ #include <xtables.h>
+ #include <linux/netfilter.h>
+ #include <linux/netfilter/xt_iprange.h>
+diff -Naur iptables-1.4.2.orig/extensions/libxt_owner.c iptables-1.4.2/extensions/libxt_owner.c
+--- iptables-1.4.2.orig/extensions/libxt_owner.c	2008-10-08 09:31:58.000000000 -0700
++++ iptables-1.4.2/extensions/libxt_owner.c	2009-01-26 14:58:48.846988126 -0800
+@@ -324,7 +324,7 @@
+ 		return;
+ 	if (info->invert & flag)
+ 		printf("! ");
+-	printf(label);
++	printf("%s ", label);
+ 
+ 	switch (info->match & flag) {
+ 	case IPT_OWNER_UID:
+@@ -375,7 +375,7 @@
+ 		return;
+ 	if (info->invert & flag)
+ 		printf("! ");
+-	printf(label);
++	printf("%s ", label);
+ 
+ 	switch (info->match & flag) {
+ 	case IP6T_OWNER_UID:
+diff -Naur iptables-1.4.2.orig/extensions/libxt_TOS.c iptables-1.4.2/extensions/libxt_TOS.c
+--- iptables-1.4.2.orig/extensions/libxt_TOS.c	2008-10-08 09:31:58.000000000 -0700
++++ iptables-1.4.2/extensions/libxt_TOS.c	2009-01-26 14:57:52.122570191 -0800
+@@ -8,6 +8,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <netinet/in.h>
+ 
+ #include <xtables.h>
+ #include <linux/netfilter/xt_DSCP.h>
+diff -Naur iptables-1.4.2.orig/include/xtables.h.in iptables-1.4.2/include/xtables.h.in
+--- iptables-1.4.2.orig/include/xtables.h.in	2008-10-08 09:31:58.000000000 -0700
++++ iptables-1.4.2/include/xtables.h.in	2009-01-26 14:57:30.449986869 -0800
+@@ -5,6 +5,7 @@
+ #include <sys/types.h>
+ #include <stdbool.h>
+ #include <net/if.h>
++#include <netinet/in.h>
+ #include <linux/types.h>
+ #include <linux/netfilter/x_tables.h>
+ 
+diff -Naur iptables-1.4.2.orig/Makefile.in iptables-1.4.2/Makefile.in
+--- iptables-1.4.2.orig/Makefile.in	2008-10-13 05:36:47.000000000 -0700
++++ iptables-1.4.2/Makefile.in	2009-01-26 14:58:29.770686408 -0800
+@@ -87,7 +87,7 @@
+ 	"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)"
+ libLTLIBRARIES_INSTALL = $(INSTALL)
+ LTLIBRARIES = $(lib_LTLIBRARIES)
+-libxtables_la_LIBADD =
++libxtables_la_DEPENDENCIES =
+ am_libxtables_la_OBJECTS = xtables.lo
+ libxtables_la_OBJECTS = $(am_libxtables_la_OBJECTS)
+ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+@@ -353,11 +353,12 @@
+ lib_LTLIBRARIES = libxtables.la
+ libxtables_la_SOURCES = xtables.c
+ libxtables_la_LDFLAGS = -version 0:0:0
++libxtables_la_LIBADD = -ldl
+ 
+ # iptables, dynamic
+ iptables_SOURCES = iptables-standalone.c iptables.c
+ iptables_LDFLAGS = -rdynamic
+-iptables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext4.a libxtables.la
++iptables_LDADD = libiptc/libiptc.a extensions/libext4.a libxtables.la -ldl -lm
+ iptables_multi_SOURCES = iptables-multi.c iptables-save.c \
+                             iptables-restore.c iptables-xml.c \
+                             iptables-standalone.c iptables.c
+@@ -375,13 +376,13 @@
+ # iptables-multi, semi-static
+ iptables_static_SOURCES = ${iptables_multi_SOURCES} xtables.c
+ iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1
+-iptables_static_LDADD = -lm libiptc/libiptc.a extensions/libext4.a
++iptables_static_LDADD = libiptc/libiptc.a extensions/libext4.a -lm
+ iptables_xml_SOURCES = iptables-xml.c
+ 
+ # ip6tables, dynamic
+ ip6tables_SOURCES = ip6tables-standalone.c ip6tables.c
+ ip6tables_LDFLAGS = -rdynamic
+-ip6tables_LDADD = -ldl -lm libiptc/libiptc.a extensions/libext6.a libxtables.la
++ip6tables_LDADD = libiptc/libiptc.a extensions/libext6.a libxtables.la -ldl -lm
+ ip6tables_multi_SOURCES = ip6tables-multi.c ip6tables-save.c \
+                             ip6tables-restore.c ip6tables-standalone.c \
+                             ip6tables.c
+@@ -399,7 +400,7 @@
+ # iptables-multi, semi-static
+ ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES} xtables.c
+ ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1
+-ip6tables_static_LDADD = -lm libiptc/libiptc.a extensions/libext6.a
++ip6tables_static_LDADD = libiptc/libiptc.a extensions/libext6.a -lm
+ noinst_LIBRARIES := libiptc/libiptc.a
+ man_MANS := iptables.8 iptables-restore.8 iptables-save.8 \
+                     iptables-xml.8 ip6tables.8 ip6tables-restore.8 \
+@@ -1529,7 +1530,7 @@
+ # ldconfig may fail when we are not root (as is the case in build systems)
+ # so add appropriate protection that it does not let `make` fail.
+ install-exec-hook:
+-	-/sbin/ldconfig || :;
++	-[ -z "$(DESTDIR)" ] && /sbin/ldconfig
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
