diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-06-14 02:22:14 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-06-14 02:22:14 +0000 |
commit | bb2c2a417d86aa1eeade1222d6db1a3a8a54f340 (patch) | |
tree | 58dd015d014d912f313ca7f48c27ec602c79e2bf | |
parent | 3ef0de937273e699c3ea303f18ffeee1468a4ec2 (diff) |
pool_get()s not in interrupt context should not be PR_NOWAIT, but
PR_WAITOK | PR_LIMITFAIL. from discussion with art. ok ryan claudio thib
-rw-r--r-- | sys/net/pf_if.c | 4 | ||||
-rw-r--r-- | sys/net/pf_ioctl.c | 15 | ||||
-rw-r--r-- | sys/net/pf_osfp.c | 11 | ||||
-rw-r--r-- | sys/net/pf_table.c | 6 |
4 files changed, 20 insertions, 16 deletions
diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index c38ddbc1527..dcc8919879d 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.52 2008/05/18 11:54:04 mcbride Exp $ */ +/* $OpenBSD: pf_if.c,v 1.53 2008/06/14 02:22:13 henning Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -332,7 +332,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *aw, sa_family_t af) if (aw->type != PF_ADDR_DYNIFTL) return (0); - if ((dyn = pool_get(&pfi_addr_pl, PR_NOWAIT)) == NULL) + if ((dyn = pool_get(&pfi_addr_pl, PR_WAITOK|PR_LIMITFAIL)) == NULL) return (1); bzero(dyn, sizeof(*dyn)); diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 99b557729c0..713f808e385 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.205 2008/06/11 20:51:34 mcbride Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.206 2008/06/14 02:22:13 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1168,7 +1168,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = EBUSY; break; } - rule = pool_get(&pf_rule_pl, PR_NOWAIT); + rule = pool_get(&pf_rule_pl, PR_WAITOK|PR_LIMITFAIL); if (rule == NULL) { error = ENOMEM; break; @@ -1410,7 +1410,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } if (pcr->action != PF_CHANGE_REMOVE) { - newrule = pool_get(&pf_rule_pl, PR_NOWAIT); + newrule = pool_get(&pf_rule_pl, PR_WAITOK|PR_LIMITFAIL); if (newrule == NULL) { error = ENOMEM; break; @@ -1686,7 +1686,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = EINVAL; break; } - s = pool_get(&pf_state_pl, PR_NOWAIT | PR_ZERO); + s = pool_get(&pf_state_pl, PR_WAITOK | PR_LIMITFAIL | PR_ZERO); if (s == NULL) { error = ENOMEM; break; @@ -1984,7 +1984,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = EBUSY; break; } - altq = pool_get(&pf_altq_pl, PR_NOWAIT); + altq = pool_get(&pf_altq_pl, PR_WAITOK|PR_LIMITFAIL); if (altq == NULL) { error = ENOMEM; break; @@ -2124,7 +2124,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) error = EINVAL; break; } - pa = pool_get(&pf_pooladdr_pl, PR_NOWAIT); + pa = pool_get(&pf_pooladdr_pl, PR_WAITOK|PR_LIMITFAIL); if (pa == NULL) { error = ENOMEM; break; @@ -2218,7 +2218,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) break; } if (pca->action != PF_CHANGE_REMOVE) { - newpa = pool_get(&pf_pooladdr_pl, PR_NOWAIT); + newpa = pool_get(&pf_pooladdr_pl, + PR_WAITOK|PR_LIMITFAIL); if (newpa == NULL) { error = ENOMEM; break; diff --git a/sys/net/pf_osfp.c b/sys/net/pf_osfp.c index 57344e155fc..75f33032e1a 100644 --- a/sys/net/pf_osfp.c +++ b/sys/net/pf_osfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_osfp.c,v 1.14 2008/06/12 18:17:01 henning Exp $ */ +/* $OpenBSD: pf_osfp.c,v 1.15 2008/06/14 02:22:13 henning Exp $ */ /* * Copyright (c) 2003 Mike Frantzen <frantzen@w4g.org> @@ -366,10 +366,12 @@ pf_osfp_add(struct pf_osfp_ioctl *fpioc) if (PF_OSFP_ENTRY_EQ(entry, &fpioc->fp_os)) return (EEXIST); } - if ((entry = pool_get(&pf_osfp_entry_pl, PR_NOWAIT)) == NULL) + if ((entry = pool_get(&pf_osfp_entry_pl, + PR_WAITOK|PR_LIMITFAIL)) == NULL) return (ENOMEM); } else { - if ((fp = pool_get(&pf_osfp_pl, PR_NOWAIT)) == NULL) + if ((fp = pool_get(&pf_osfp_pl, + PR_WAITOK|PR_LIMITFAIL)) == NULL) return (ENOMEM); memset(fp, 0, sizeof(*fp)); fp->fp_tcpopts = fpioc->fp_tcpopts; @@ -381,7 +383,8 @@ pf_osfp_add(struct pf_osfp_ioctl *fpioc) fp->fp_wscale = fpioc->fp_wscale; fp->fp_ttl = fpioc->fp_ttl; SLIST_INIT(&fp->fp_oses); - if ((entry = pool_get(&pf_osfp_entry_pl, PR_NOWAIT)) == NULL) { + if ((entry = pool_get(&pf_osfp_entry_pl, + PR_WAITOK|PR_LIMITFAIL)) == NULL) { pool_put(&pf_osfp_pl, fp); return (ENOMEM); } diff --git a/sys/net/pf_table.c b/sys/net/pf_table.c index ff605324110..43ce7259938 100644 --- a/sys/net/pf_table.c +++ b/sys/net/pf_table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_table.c,v 1.76 2008/06/10 22:39:31 mcbride Exp $ */ +/* $OpenBSD: pf_table.c,v 1.77 2008/06/14 02:22:13 henning Exp $ */ /* * Copyright (c) 2002 Cedric Berger @@ -813,7 +813,7 @@ pfr_create_kentry(struct pfr_addr *ad, int intr) if (intr) ke = pool_get(&pfr_kentry_pl2, PR_NOWAIT | PR_ZERO); else - ke = pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO); + ke = pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL); if (ke == NULL) return (NULL); @@ -1900,7 +1900,7 @@ pfr_create_ktable(struct pfr_table *tbl, long tzero, int attachruleset) struct pfr_ktable *kt; struct pf_ruleset *rs; - kt = pool_get(&pfr_ktable_pl, PR_NOWAIT | PR_ZERO); + kt = pool_get(&pfr_ktable_pl, PR_WAITOK | PR_ZERO | PR_LIMITFAIL); if (kt == NULL) return (NULL); kt->pfrkt_t = *tbl; |