diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-12-16 00:54:43 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2021-12-16 00:54:43 +0000 |
commit | 46af39fe24ac4f08f1db3781001e54baaf1de786 (patch) | |
tree | 7bbc6974f66f21da5e3fdc6543d93e59901214e6 /sys/net/if_wg.c | |
parent | 1b44456b360b63c92bd7c7e3aa1736b36e1b55ec (diff) |
pool_get w/ PR_ZERO is better than following with a bzero, because pools
hold dirty and clean memory, and can hand out the right time cheaper
ok dlg
Diffstat (limited to 'sys/net/if_wg.c')
-rw-r--r-- | sys/net/if_wg.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c index bab21d96c74..996ab20d9e4 100644 --- a/sys/net/if_wg.c +++ b/sys/net/if_wg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wg.c,v 1.18 2021/08/05 13:37:04 sthen Exp $ */ +/* $OpenBSD: if_wg.c,v 1.19 2021/12/16 00:54:42 deraadt Exp $ */ /* * Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. @@ -599,9 +599,8 @@ wg_aip_add(struct wg_softc *sc, struct wg_peer *peer, struct wg_aip_io *d) default: return EAFNOSUPPORT; } - if ((aip = pool_get(&wg_aip_pool, PR_NOWAIT)) == NULL) + if ((aip = pool_get(&wg_aip_pool, PR_NOWAIT|PR_ZERO)) == NULL) return ENOBUFS; - bzero(aip, sizeof(*aip)); rw_enter_write(&root->ar_lock); node = art_insert(root, &aip->a_node, &d->a_addr, d->a_cidr); |