Fix 'ipfw delete set N':

do not emit meaningless 'rule 0 not found' warning if set was already empty.

MFC after:	1 week
This commit is contained in:
oleg 2016-11-29 10:43:58 +00:00
parent cb9e4cd652
commit 2f47929e75

View File

@ -3221,7 +3221,7 @@ ipfw_delete(char *av[])
exitval = EX_UNAVAILABLE;
warn("rule %u: setsockopt(IP_FW_XDEL)",
rt.start_rule);
} else if (rt.new_set == 0) {
} else if (rt.new_set == 0 && do_set == 0) {
exitval = EX_UNAVAILABLE;
if (rt.start_rule != rt.end_rule)
warnx("no rules rules in %u-%u range",