diff -urN iptables-1.4.1.1.orig/iptables-batch.c iptables-1.4.1.1/iptables-batch.c
--- iptables-1.4.1.1.orig/iptables-batch.c 1970-01-01 01:00:00.000000000 +0100
+++ iptables-1.4.1.1/iptables-batch.c 2008-08-24 10:42:00.000000000 +0200
-@@ -0,0 +1,471 @@
+@@ -0,0 +1,474 @@
+/*
+ * Author: Ludwig Nussel <ludwig.nussel@suse.de>
+ *
+{
+ char* name;
+#ifdef BATCH_IPV6
-+ ip6tc_handle *handle;
++ struct ip6tc_handle *handle;
+#else
-+ iptc_handle *handle;
++ struct iptc_handle *handle;
+#endif
+};
+
+static unsigned num_tables;
+struct table_handle* current_table;
+
++/* Search path for Xtables .so files */
++static const char *xtables_libdir;
++
+static void
+alloc_tables()
+{
+ if(tables[i].handle)
+ {
+#ifdef BATCH_IPV6
-+ if(!ip6tc_commit(&tables[i].handle))
++ if(!ip6tc_commit(tables[i].handle))
+ {
+ fprintf(stderr, "commit failed on table %s: %s\n", tables[i].name, ip6tc_strerror(errno));
+ ret = 0;
+ }
+#else
-+ if(!iptc_commit(&tables[i].handle))
++ if(!iptc_commit(tables[i].handle))
+ {
+ fprintf(stderr, "commit failed on table %s: %s\n", tables[i].name, iptc_strerror(errno));
+ ret = 0;
+static void
+help()
+{
-+ fprintf(stderr, "Usage: %s [FILE]\n\n", program_name);
++ fprintf(stderr, "Usage: %s [FILE]\n\n", xt_params->program_name);
+ puts("Read iptables commands from FILE, commit them at EOF\n");
+ puts("In addition to normal iptables calls the commands");
+ puts("'commit' and 'exit' are understood.");
+ FILE* fp = stdin;
+
+#ifdef BATCH_IPV6
-+ program_name = "ip6tables-batch";
++ //program_name = "ip6tables-batch";
+
-+ lib_dir = getenv("XTABLES_LIBDIR");
-+ if (!lib_dir) {
-+ lib_dir = getenv("IP6TABLES_LIB_DIR");
-+ if (!lib_dir)
-+ lib_dir = XTABLES_LIBDIR;
++ xtables_libdir = getenv("XTABLES_LIBDIR");
++ if (!xtables_libdir) {
++ xtables_libdir = getenv("IP6TABLES_LIB_DIR");
++ if (!xtables_libdir)
++ xtables_libdir = XTABLES_LIBDIR;
+ }
+#else
-+ program_name = "iptables-batch";
++ //program_name = "iptables-batch";
+
-+ lib_dir = getenv("XTABLES_LIBDIR");
-+ if (!lib_dir) {
-+ lib_dir = getenv("IPTABLES_LIB_DIR");
-+ if (!lib_dir)
-+ lib_dir = XTABLES_LIBDIR;
++ xtables_libdir = getenv("XTABLES_LIBDIR");
++ if (!xtables_libdir) {
++ xtables_libdir = getenv("IPTABLES_LIB_DIR");
++ if (!xtables_libdir)
++ xtables_libdir = XTABLES_LIBDIR;
+ }
+
+#endif
-+ program_version = XTABLES_VERSION;
++ //program_version = XTABLES_VERSION;
+
+#ifdef NO_SHARED_LIBS
+ init_extensions();
iptables_static_SOURCES = ${iptables_multi_SOURCES} xtables.c
-iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1
+iptables_static_CFLAGS = ${iptables_multi_CFLAGS} -DNO_SHARED_LIBS=1 -DBATCH_IPV4
- iptables_static_LDADD = -lm libiptc/libiptc.la extensions/libext4.a
+ iptables_static_LDADD = libiptc/libiptc.la extensions/libext4.a -lm
iptables_xml_SOURCES = iptables-xml.c
@@ -58,8 +63,8 @@
ip6tables_static_SOURCES = ${ip6tables_multi_SOURCES} xtables.c
-ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1
+ip6tables_static_CFLAGS = ${ip6tables_multi_CFLAGS} -DNO_SHARED_LIBS=1 -DBATCH_IPV6
- ip6tables_static_LDADD = -lm libiptc/libiptc.la extensions/libext6.a
+ ip6tables_static_LDADD = libiptc/libiptc.la extensions/libext6.a -lm
bin_PROGRAMS = iptables-xml
@@ -89,7 +99,8 @@