From 6c6928721a1bfc8f941ba805af9b071850580fb6 Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=yasuyuki/emailAddress=yasuyuki@netfilter.org" Date: Sat, 9 Dec 2006 13:06:04 +0000 Subject: fix compile/install error for iptables-xml with DO_MULTI=1 (Lutz Jaenicke) --- Makefile | 2 +- ip6tables-restore.c | 2 +- iptables-multi.c | 4 ++++ iptables-restore.c | 2 +- iptables-xml.c | 11 ++++++----- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index b651063..c3e2700 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 f7eac68..a0c359a 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 0563099..7ade333 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 cc49c73..628997e 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 34437e0..ce3049c 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[]) -- cgit v1.2.3