aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2026-01-12 15:59:22 +0000
committerKristof Provost <kp@FreeBSD.org>2026-01-14 06:44:41 +0000
commitf2d2d6f010e48410a4435f73aa60ad3dcefccd3b (patch)
tree298ceeccaa405e7fb8bb80eaaa5fa2864282abc0
parent02126f8cb35ca66380a43a58143e0c37154a99d3 (diff)
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")
-rw-r--r--sys/netpfil/pf/pf_ioctl.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index bc998113dbbb..f6040e2f03a8 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -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])