Use IPFW_DEFAULT_RULE instead of hardcoded value since now it is
available. MFC after: 5 days.
This commit is contained in:
parent
9d365d36cc
commit
759dd6f7f7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=182823
@ -2429,7 +2429,7 @@ sets_handler(int ac, char *av[])
|
|||||||
rulenum = atoi(av[0]);
|
rulenum = atoi(av[0]);
|
||||||
new_set = atoi(av[2]);
|
new_set = atoi(av[2]);
|
||||||
if (!isdigit(*(av[0])) || (cmd == 3 && rulenum > RESVD_SET) ||
|
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]);
|
errx(EX_DATAERR, "invalid source number %s\n", av[0]);
|
||||||
if (!isdigit(*(av[2])) || new_set > RESVD_SET)
|
if (!isdigit(*(av[2])) || new_set > RESVD_SET)
|
||||||
errx(EX_DATAERR, "invalid dest. set %s\n", av[1]);
|
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.
|
* need to scan the list to count them.
|
||||||
*/
|
*/
|
||||||
for (nstat = 1, r = data, lim = (char *)data + nbytes;
|
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) )
|
++nstat, r = NEXT(r) )
|
||||||
; /* nothing */
|
; /* nothing */
|
||||||
|
|
||||||
@ -5045,7 +5045,8 @@ add(int ac, char *av[])
|
|||||||
if (have_tag)
|
if (have_tag)
|
||||||
errx(EX_USAGE, "tag and untag cannot be "
|
errx(EX_USAGE, "tag and untag cannot be "
|
||||||
"specified more than once");
|
"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;
|
have_tag = cmd;
|
||||||
fill_cmd(cmd, O_TAG, (i == TOK_TAG) ? 0: F_NOT, tag);
|
fill_cmd(cmd, O_TAG, (i == TOK_TAG) ? 0: F_NOT, tag);
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
@ -5521,8 +5522,8 @@ add(int ac, char *av[])
|
|||||||
if (c->limit_mask == 0)
|
if (c->limit_mask == 0)
|
||||||
errx(EX_USAGE, "limit: missing limit mask");
|
errx(EX_USAGE, "limit: missing limit mask");
|
||||||
|
|
||||||
GET_UINT_ARG(c->conn_limit, 1, 65534, TOK_LIMIT,
|
GET_UINT_ARG(c->conn_limit, 1, IPFW_DEFAULT_RULE - 1,
|
||||||
rule_options);
|
TOK_LIMIT, rule_options);
|
||||||
|
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
break;
|
break;
|
||||||
@ -5649,8 +5650,8 @@ add(int ac, char *av[])
|
|||||||
else {
|
else {
|
||||||
uint16_t tag;
|
uint16_t tag;
|
||||||
|
|
||||||
GET_UINT_ARG(tag, 1, 65534, TOK_TAGGED,
|
GET_UINT_ARG(tag, 1, IPFW_DEFAULT_RULE - 1,
|
||||||
rule_options);
|
TOK_TAGGED, rule_options);
|
||||||
fill_cmd(cmd, O_TAGGED, 0, tag);
|
fill_cmd(cmd, O_TAGGED, 0, tag);
|
||||||
}
|
}
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
@ -5978,7 +5979,7 @@ show_nat(int ac, char **av) {
|
|||||||
size = 0;
|
size = 0;
|
||||||
data = NULL;
|
data = NULL;
|
||||||
frule = 0;
|
frule = 0;
|
||||||
lrule = 65535; /* max ipfw rule number */
|
lrule = IPFW_DEFAULT_RULE; /* max ipfw rule number */
|
||||||
ac--; av++;
|
ac--; av++;
|
||||||
|
|
||||||
/* Parse parameters. */
|
/* Parse parameters. */
|
||||||
|
Loading…
Reference in New Issue
Block a user