summaryrefslogtreecommitdiffstats
path: root/iptables/ip6tables.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2021-11-26 21:11:25 +0100
committerPhil Sutter <phil@nwl.cc>2021-12-16 14:30:29 +0100
commit316d8efbb7cd2d252c8627df77261a466493d09b (patch)
tree5ecf053e8cd5313517ef900e8d79f5e455e0cac6 /iptables/ip6tables.c
parent4bff5aef6e63fb4d403d539f4c9d2d90492120b8 (diff)
libxtables: Extend basic_exit_err()
Basically merge the function with xtables_exit_error, printing a status-specific footer for parameter or version problems. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'iptables/ip6tables.c')
-rw-r--r--iptables/ip6tables.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 44d2c08c..2f3ff034 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -87,12 +87,10 @@ static struct option original_opts[] = {
{NULL},
};
-void ip6tables_exit_error(enum xtables_exittype status, const char *msg, ...) __attribute__((noreturn, format(printf,2,3)));
struct xtables_globals ip6tables_globals = {
.option_offset = 0,
.program_version = PACKAGE_VERSION " (legacy)",
.orig_opts = original_opts,
- .exit_err = ip6tables_exit_error,
.compat_rev = xtables_compatible_revision,
};
@@ -107,26 +105,6 @@ exit_printhelp(const struct xtables_rule_match *matches)
exit(0);
}
-void
-ip6tables_exit_error(enum xtables_exittype status, const char *msg, ...)
-{
- va_list args;
-
- va_start(args, msg);
- fprintf(stderr, "%s v%s: ", prog_name, prog_vers);
- vfprintf(stderr, msg, args);
- va_end(args);
- fprintf(stderr, "\n");
- if (status == PARAMETER_PROBLEM)
- exit_tryhelp(status, line);
- if (status == VERSION_PROBLEM)
- fprintf(stderr,
- "Perhaps ip6tables or your kernel needs to be upgraded.\n");
- /* On error paths, make sure that we don't leak memory */
- xtables_free_opts(1);
- exit(status);
-}
-
/*
* All functions starting with "parse" should succeed, otherwise
* the program fails.