summaryrefslogtreecommitdiffstats
path: root/ip6tables.c
diff options
context:
space:
mode:
authorgandalf <gandalf>2004-05-26 15:41:54 +0000
committergandalf <gandalf>2004-05-26 15:41:54 +0000
commit046bd53ff9817a02df89295178e9e5713a8c2bcc (patch)
tree36ea5d3e697a0b7a15540532d49ac71406b5abe6 /ip6tables.c
parente3053abc92b890e12c5cdb9445e58a234f517e38 (diff)
When compiled static, don't show help-messages for all matches and targets,
only show help for specified ones.
Diffstat (limited to 'ip6tables.c')
-rw-r--r--ip6tables.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/ip6tables.c b/ip6tables.c
index b2816ba..ee42c08 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -292,9 +292,9 @@ exit_tryhelp(int status)
}
void
-exit_printhelp(void)
+exit_printhelp(struct ip6tables_rule_match *matches)
{
- struct ip6tables_match *m = NULL;
+ struct ip6tables_rule_match *matchp = NULL;
struct ip6tables_target *t = NULL;
printf("%s v%s\n\n"
@@ -359,14 +359,16 @@ exit_printhelp(void)
/* Print out any special helps. A user might like to be able to add a --help
to the commandline, and see expected results. So we call help for all
- matches & targets */
- for (t=ip6tables_targets;t;t=t->next) {
- printf("\n");
- t->help();
+ specified matches & targets */
+ for (t = ip6tables_targets; t; t = t->next) {
+ if (t->used) {
+ printf("\n");
+ t->help();
+ }
}
- for (m=ip6tables_matches;m;m=m->next) {
+ for (matchp = matches; matchp; matchp = matchp->next) {
printf("\n");
- m->help();
+ matchp->match->help();
}
exit(0);
}
@@ -1839,10 +1841,10 @@ int do_command6(int argc, char *argv[], char **table, ip6tc_handle_t *handle)
optarg = argv[optind];
/* iptables -p icmp -h */
- if (!ip6tables_matches && protocol)
- find_match(protocol, TRY_LOAD, NULL);
+ if (!matches && protocol)
+ find_match(protocol, TRY_LOAD, &matches);
- exit_printhelp();
+ exit_printhelp(matches);
/*
* Option selection