pf: remove redundant range checks

the range checks are not needed because both members
(statelim and sourcelim) are uint8_t, they implicitly
fit desired range <0, 255>. Unbreaks gcc build.
Pointed out by deraadt@

OK deraadt@

Obtained from:	OpenBSD, sashan <sashan@openbsd.org>, 3a7be1e428
Sponsored by:	Rubicon Communications, LLC ("Netgate")
This commit is contained in:
Kristof Provost
2026-01-12 16:59:22 +01:00
parent 02126f8cb3
commit f2d2d6f010
-12
View File
@@ -2950,18 +2950,6 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket,
if (pf_validate_range(rule->dst.port_op, rule->dst.port))
ERROUT_UNLOCKED(EINVAL);
if (rule->statelim != PF_STATELIM_ID_NONE) {
if (rule->statelim < PF_STATELIM_ID_MIN ||
rule->statelim > PF_STATELIM_ID_MAX)
ERROUT_UNLOCKED(EINVAL);
}
if (rule->sourcelim != PF_SOURCELIM_ID_NONE) {
if (rule->sourcelim < PF_SOURCELIM_ID_MIN ||
rule->sourcelim > PF_SOURCELIM_ID_MAX)
ERROUT_UNLOCKED(EINVAL);
}
if (rule->ifname[0])
kif = pf_kkif_create(M_WAITOK);
if (rule->rcv_ifname[0])