diff options
author | rik <rik@FreeBSD.org> | 2008-09-06 17:23:37 +0000 |
---|---|---|
committer | rik <rik@FreeBSD.org> | 2008-09-06 17:23:37 +0000 |
commit | 65828aa4c7f5c98c28dd5864555de7a10a0acb62 (patch) | |
tree | f65a727c4d36e850e9334997617ab3f744ba890e /sbin/ipfw | |
parent | 75452e6eca87053c8c30a6e0dfda976378ee9b51 (diff) | |
download | FreeBSD-src-65828aa4c7f5c98c28dd5864555de7a10a0acb62.zip FreeBSD-src-65828aa4c7f5c98c28dd5864555de7a10a0acb62.tar.gz |
Use IPFW_DEFAULT_RULE instead of hardcoded value since now it is
available.
MFC after: 5 days.
Diffstat (limited to 'sbin/ipfw')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index 9208ff0..78d758f 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -2429,7 +2429,7 @@ sets_handler(int ac, char *av[]) rulenum = atoi(av[0]); new_set = atoi(av[2]); if (!isdigit(*(av[0])) || (cmd == 3 && rulenum > RESVD_SET) || - (cmd == 2 && rulenum == 65535) ) + (cmd == 2 && rulenum == IPFW_DEFAULT_RULE) ) errx(EX_DATAERR, "invalid source number %s\n", av[0]); if (!isdigit(*(av[2])) || new_set > RESVD_SET) errx(EX_DATAERR, "invalid dest. set %s\n", av[1]); @@ -2553,7 +2553,7 @@ list(int ac, char *av[], int show_counters) * need to scan the list to count them. */ for (nstat = 1, r = data, lim = (char *)data + nbytes; - r->rulenum < 65535 && (char *)r < lim; + r->rulenum < IPFW_DEFAULT_RULE && (char *)r < lim; ++nstat, r = NEXT(r) ) ; /* nothing */ @@ -5045,7 +5045,8 @@ chkarg: if (have_tag) errx(EX_USAGE, "tag and untag cannot be " "specified more than once"); - GET_UINT_ARG(tag, 1, 65534, i, rule_action_params); + GET_UINT_ARG(tag, 1, IPFW_DEFAULT_RULE - 1, i, + rule_action_params); have_tag = cmd; fill_cmd(cmd, O_TAG, (i == TOK_TAG) ? 0: F_NOT, tag); ac--; av++; @@ -5521,8 +5522,8 @@ read_options: if (c->limit_mask == 0) errx(EX_USAGE, "limit: missing limit mask"); - GET_UINT_ARG(c->conn_limit, 1, 65534, TOK_LIMIT, - rule_options); + GET_UINT_ARG(c->conn_limit, 1, IPFW_DEFAULT_RULE - 1, + TOK_LIMIT, rule_options); ac--; av++; break; @@ -5649,8 +5650,8 @@ read_options: else { uint16_t tag; - GET_UINT_ARG(tag, 1, 65534, TOK_TAGGED, - rule_options); + GET_UINT_ARG(tag, 1, IPFW_DEFAULT_RULE - 1, + TOK_TAGGED, rule_options); fill_cmd(cmd, O_TAGGED, 0, tag); } ac--; av++; @@ -5978,7 +5979,7 @@ show_nat(int ac, char **av) { size = 0; data = NULL; frule = 0; - lrule = 65535; /* max ipfw rule number */ + lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */ ac--; av++; /* Parse parameters. */ |