summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--ip6tables-restore.c2
-rw-r--r--iptables-multi.c4
-rw-r--r--iptables-restore.c2
-rw-r--r--iptables-xml.c11
5 files changed, 13 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index b651063b..c3e27007 100644
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,7 @@ iptables-xml: iptables-xml.c #iptables.o # $(STATIC_LIBS) libiptc/libiptc.a
$(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 --git a/ip6tables-restore.c b/ip6tables-restore.c
index f7eac680..a0c359a1 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -74,7 +74,7 @@ ip6tc_handle_t create_handle(const char *tablename, const char* modprobe)
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);
}
diff --git a/iptables-multi.c b/iptables-multi.c
index 05630995..7ade3335 100644
--- a/iptables-multi.c
+++ b/iptables-multi.c
@@ -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;
@@ -25,6 +26,9 @@ int main(int argc, char **argv) {
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);
}
diff --git a/iptables-restore.c b/iptables-restore.c
index cc49c738..628997ec 100644
--- a/iptables-restore.c
+++ b/iptables-restore.c
@@ -71,7 +71,7 @@ iptc_handle_t create_handle(const char *tablename, const char* modprobe )
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);
}
diff --git a/iptables-xml.c b/iptables-xml.c
index 34437e07..ce3049c2 100644
--- a/iptables-xml.c
+++ b/iptables-xml.c
@@ -26,10 +26,10 @@
/* no need to link with iptables.o */
const char *program_name;
const char *program_version;
-int line = 0;
-void
-exit_error(enum exittype status, char *msg, ...)
+#ifndef IPTABLES_MULTI
+int line = 0;
+void exit_error(enum exittype status, char *msg, ...)
{
va_list args;
@@ -41,6 +41,7 @@ exit_error(enum exittype status, char *msg, ...)
/* 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 @@ print_usage(const char *name, const char *version)
exit(1);
}
-int
+static int
parse_counters(char *string, struct ipt_counters *ctr)
{
if (string != NULL)
@@ -605,7 +606,7 @@ do_rule(char *pcnt, char *bcnt, int argc, char *argv[], int argvattr[])
#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[])