Show error when deleting non-existing rule number.
Found by: Oleg Ginzburg
This commit is contained in:
parent
60f485ca9f
commit
6ca0dd05f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273033
@ -3009,7 +3009,6 @@ fill_flags_cmd(ipfw_insn *cmd, enum ipfw_opcodes opcode,
|
|||||||
void
|
void
|
||||||
ipfw_delete(char *av[])
|
ipfw_delete(char *av[])
|
||||||
{
|
{
|
||||||
uint32_t rulenum;
|
|
||||||
int i;
|
int i;
|
||||||
int exitval = EX_OK;
|
int exitval = EX_OK;
|
||||||
int do_set = 0;
|
int do_set = 0;
|
||||||
@ -3059,7 +3058,15 @@ ipfw_delete(char *av[])
|
|||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
exitval = EX_UNAVAILABLE;
|
exitval = EX_UNAVAILABLE;
|
||||||
warn("rule %u: setsockopt(IP_FW_XDEL)",
|
warn("rule %u: setsockopt(IP_FW_XDEL)",
|
||||||
rulenum);
|
rt.start_rule);
|
||||||
|
} else if (rt.new_set == 0) {
|
||||||
|
exitval = EX_UNAVAILABLE;
|
||||||
|
if (rt.start_rule != rt.end_rule)
|
||||||
|
warnx("no rules rules in %u-%u range",
|
||||||
|
rt.start_rule, rt.end_rule);
|
||||||
|
else
|
||||||
|
warnx("rule %u not found",
|
||||||
|
rt.start_rule);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user