doing that in runtime within ipsp_acquire_sa().
ok bluhm@
-/* $OpenBSD: pfkeyv2.c,v 1.216 2021/07/05 12:01:20 tobhe Exp $ */
+/* $OpenBSD: pfkeyv2.c,v 1.217 2021/07/08 16:39:55 mvs Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) 17 January 1995
IPL_SOFTNET, PR_WAITOK, "pkpcb", NULL);
pool_init(&ipsec_policy_pool, sizeof(struct ipsec_policy), 0,
IPL_SOFTNET, 0, "ipsec policy", NULL);
+ pool_init(&ipsec_acquire_pool, sizeof(struct ipsec_acquire), 0,
+ IPL_SOFTNET, 0, "ipsec acquire", NULL);
}
-/* $OpenBSD: pfkeyv2.h,v 1.88 2021/07/05 12:01:20 tobhe Exp $ */
+/* $OpenBSD: pfkeyv2.h,v 1.89 2021/07/08 16:39:55 mvs Exp $ */
/*
* @(#)COPYRIGHT 1.1 (NRL) January 1998
*
extern const uint64_t sadb_exts_required_out[SADB_MAX+1];
extern struct pool ipsec_policy_pool;
+extern struct pool ipsec_acquire_pool;
#endif /* _KERNEL */
#endif /* _NET_PFKEY_V2_H_ */
-/* $OpenBSD: ip_spd.c,v 1.103 2021/05/04 09:28:04 mvs Exp $ */
+/* $OpenBSD: ip_spd.c,v 1.104 2021/07/08 16:39:55 mvs Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
struct pool ipsec_acquire_pool;
/* Protected by the NET_LOCK(). */
-int ipsec_acquire_pool_initialized = 0;
struct radix_node_head **spd_tables;
unsigned int spd_table_max;
TAILQ_HEAD(ipsec_acquire_head, ipsec_acquire) ipsec_acquire_head =
return 0;
/* Add request in cache and proceed. */
- if (ipsec_acquire_pool_initialized == 0) {
- ipsec_acquire_pool_initialized = 1;
- pool_init(&ipsec_acquire_pool, sizeof(struct ipsec_acquire),
- 0, IPL_SOFTNET, 0, "ipsec acquire", NULL);
- }
-
ipa = pool_get(&ipsec_acquire_pool, PR_NOWAIT|PR_ZERO);
if (ipa == NULL)
return ENOMEM;