diff options
author | melifaro <melifaro@FreeBSD.org> | 2014-10-17 20:47:55 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2014-10-17 20:47:55 +0000 |
commit | 48fe6db658f408de27d0a3f48acd21a172154f34 (patch) | |
tree | a2169b67dad59ba5dadc06e31608512143020f1e /sbin | |
parent | 38a908448e559751f57696639212848fc742321b (diff) | |
download | FreeBSD-src-48fe6db658f408de27d0a3f48acd21a172154f34.zip FreeBSD-src-48fe6db658f408de27d0a3f48acd21a172154f34.tar.gz |
* Fix table sets handling.
* Simplify formatting.
Suggested by: luigi
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 5 | ||||
-rw-r--r-- | sbin/ipfw/tables.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 2424519..a4c8a8a 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2138,7 +2138,7 @@ ipfw_sets_handler(char *av[]) { uint32_t masks[2]; int i; - uint8_t cmd, new_set, rulenum; + uint8_t cmd, rulenum; ipfw_range_tlv rt; char *msg; size_t size; @@ -2202,7 +2202,7 @@ ipfw_sets_handler(char *av[]) if (!isdigit(*(av[0])) || (cmd == 3 && rt.set > RESVD_SET) || (cmd == 2 && rt.start_rule == IPFW_DEFAULT_RULE) ) errx(EX_DATAERR, "invalid source number %s\n", av[0]); - if (!isdigit(*(av[2])) || new_set > RESVD_SET) + if (!isdigit(*(av[2])) || rt.new_set > RESVD_SET) errx(EX_DATAERR, "invalid dest. set %s\n", av[1]); i = do_range_cmd(cmd, &rt); } else if (_substrcmp(*av, "disable") == 0 || @@ -2543,6 +2543,7 @@ ipfw_show_config(struct cmdline_opts *co, struct format_opts *fo, dynbase = NULL; dynsz = 0; read = sizeof(*cfg); + rcnt = 0; fo->set_mask = cfg->set_mask; diff --git a/sbin/ipfw/tables.c b/sbin/ipfw/tables.c index a927373..4829fec 100644 --- a/sbin/ipfw/tables.c +++ b/sbin/ipfw/tables.c @@ -1908,7 +1908,7 @@ ipfw_list_values(int ac, char *av[]) for (i = 0; i < olh->count; i++) { table_show_value(buf, sizeof(buf), (ipfw_table_value *)v, vmask, 0); - printf("[%u] refs=%ju %s\n", v->spare1, v->refcnt, buf); + printf("[%u] refs=%lu %s\n", v->spare1, (u_long)v->refcnt, buf); v = (struct _table_value *)((caddr_t)v + olh->objsize); } |