All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lutz Jaenicke <ljaenicke@innominate.com>
To: netfilter-devel@lists.netfilter.org
Subject: iptables-xml broken with IPTABLES_MULTI
Date: Thu, 7 Dec 2006 13:38:47 +0100	[thread overview]
Message-ID: <20061207123847.GA30414@innominate.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 429 bytes --]

Hi!

as of iptables-1.3.7 a new "iptables-xml" command is added automatically
to the IPTABLES_MULTI executable. It however breaks during build.
The attached patch seems to fix it.

Best regards,
	Lutz
-- 
Dr.-Ing. Lutz Jänicke
CTO
Innominate Security Technologies AG  /protecting industrial networks/
tel: +49.30.6392-3308
fax: +49.30.6392-3307
Albert-Einstein-Str. 14
D-12489 Berlin, Germany
www.innominate.com

[-- Attachment #2: iptables-multi.diff --]
[-- Type: text/plain, Size: 3105 bytes --]

Index: ip6tables-restore.c
===================================================================
RCS file: /cvs/mguard/iptables/ip6tables-restore.c,v
retrieving revision 1.5
diff -u -r1.5 ip6tables-restore.c
--- ip6tables-restore.c	9 Oct 2006 08:21:24 -0000	1.5
+++ ip6tables-restore.c	7 Dec 2006 12:27:38 -0000
@@ -74,7 +74,7 @@
 	return handle;
 }
 
-int parse_counters(char *string, struct ip6t_counters *ctr)
+static int parse_counters(char *string, struct ip6t_counters *ctr)
 {
 	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)&ctr->pcnt, (unsigned long long *)&ctr->bcnt) == 2);
 }
Index: iptables-multi.c
===================================================================
RCS file: /cvs/mguard/iptables/iptables-multi.c,v
retrieving revision 1.5
diff -u -r1.5 iptables-multi.c
--- iptables-multi.c	18 Oct 2006 17:44:45 -0000	1.5
+++ iptables-multi.c	7 Dec 2006 12:27:38 -0000
@@ -12,6 +12,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 innominate_log_api = 0;
 
@@ -72,6 +73,9 @@
     if (!strcmp(progname, "iptables-restore"))
       return iptables_restore_main(argc, argv);
     
+    if (!strcmp(progname, "iptables-xml"))
+      return iptables_xml_main(argc, argv);
+    
     fprintf(stderr, "iptables multi-purpose version: unknown applet name %s\n", progname);
     exit(1);
   }
Index: iptables-restore.c
===================================================================
RCS file: /cvs/mguard/iptables/iptables-restore.c,v
retrieving revision 1.5
diff -u -r1.5 iptables-restore.c
--- iptables-restore.c	9 Oct 2006 08:21:24 -0000	1.5
+++ iptables-restore.c	7 Dec 2006 12:27:38 -0000
@@ -71,7 +71,7 @@
 	return handle;
 }
 
-int parse_counters(char *string, struct ipt_counters *ctr)
+static int parse_counters(char *string, struct ipt_counters *ctr)
 {
 	return (sscanf(string, "[%llu:%llu]", (unsigned long long *)&ctr->pcnt, (unsigned long long *)&ctr->bcnt) == 2);
 }
Index: iptables-xml.c
===================================================================
RCS file: /cvs/mguard/iptables/iptables-xml.c,v
retrieving revision 1.1
diff -u -r1.1 iptables-xml.c
--- iptables-xml.c	7 Dec 2006 12:08:48 -0000	1.1
+++ iptables-xml.c	7 Dec 2006 12:27:38 -0000
@@ -26,9 +26,9 @@
 /* no need to link with iptables.o */
 const char *program_name;
 const char *program_version;
-int line = 0;
 
-void
+#ifndef IPTABLES_MULTI
+int line = 0;
 exit_error(enum exittype status, char *msg, ...)
 {
 	va_list args;
@@ -41,6 +41,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 +67,7 @@
 	exit(1);
 }
 
-int
+static int
 parse_counters(char *string, struct ipt_counters *ctr)
 {
 	if (string != NULL)
@@ -605,7 +606,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[])

             reply	other threads:[~2006-12-07 12:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-07 12:38 Lutz Jaenicke [this message]
2006-12-07 12:49 ` iptables-xml broken with IPTABLES_MULTI Yasuyuki KOZAKAI
2006-12-11  4:00   ` Yasuyuki KOZAKAI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061207123847.GA30414@innominate.com \
    --to=ljaenicke@innominate.com \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.