X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=iptables.c;h=df0d70425eaf4cc48dd9c382f2a88d83477ea01e;hp=ab3b3020696aba2ab135c5aa4b71aa70fcc8a8a9;hb=9e7b8360c3f9c7d518322e732e6d8ddfbbf43c60;hpb=e43e3cc546ef1d79ca2125e2381662bf9501ccd4 diff --git a/iptables.c b/iptables.c index ab3b302..df0d704 100644 --- a/iptables.c +++ b/iptables.c @@ -22,7 +22,6 @@ static struct option base_opts[] = { { .name = "match", .has_arg = 1, .val = 'm' }, { .name = "jump", .has_arg = 1, .val = 'j' }, - { .name = "append", .has_arg = 1, .val = 'A' }, { NULL } }; @@ -1337,7 +1336,8 @@ __fw3_ipt_rule_append(struct fw3_ipt_rule *r, bool repl, const char *fmt, ...) optind = 0; opterr = 0; - while ((optc = getopt_long(r->argc, r->argv, "m:j:", g->opts, NULL)) != -1) + while ((optc = getopt_long(r->argc, r->argv, "-:m:j:", g->opts, + NULL)) != -1) { switch (optc) { @@ -1367,6 +1367,7 @@ __fw3_ipt_rule_append(struct fw3_ipt_rule *r, bool repl, const char *fmt, ...) case 1: if ((optarg[0] == '!') && (optarg[1] == '\0')) { + optarg[0] = '\0'; inv = true; continue; }