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:
