From: kn Date: Thu, 11 May 2023 12:36:22 +0000 (+0000) Subject: pools are always initialised, zap overcautious NULL check X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7d148a58904ce73378e37cdec4a95be3c45c57a3;p=openbsd pools are always initialised, zap overcautious NULL check All pools are init'd after pfattach(), none is ever destroyed, so struct pf_pool_limit's .pp always points to valid pools. Drop a check for the impossible from twenty years ago. OK sashan dlg --- diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 14c377d5ef6..f70796cdd2e 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.403 2023/05/03 10:32:48 kn Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.404 2023/05/11 12:36:22 kn Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -2107,8 +2107,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) NET_LOCK(); PF_LOCK(); - if (pl->index < 0 || pl->index >= PF_LIMIT_MAX || - pf_pool_limits[pl->index].pp == NULL) { + if (pl->index < 0 || pl->index >= PF_LIMIT_MAX) { error = EINVAL; PF_UNLOCK(); NET_UNLOCK();