Index: in_pcb.c =================================================================== RCS file: /cvs/src/sys/netinet/in_pcb.c,v retrieving revision 1.247 diff -u -p -r1.247 in_pcb.c --- in_pcb.c 4 Oct 2018 17:33:41 -0000 1.247 +++ in_pcb.c 21 May 2019 04:35:39 -0000 @@ -114,7 +114,6 @@ int ipport_hilastauto = IPPORT_HILASTAUT struct baddynamicports baddynamicports; struct baddynamicports rootonlyports; struct pool inpcb_pool; -int inpcb_pool_initialized = 0; int in_pcbresize (struct inpcbtable *, int); @@ -158,6 +157,12 @@ in_pcblhash(struct inpcbtable *table, in void in_pcbinit(struct inpcbtable *table, int hashsize) { + static int inpcb_pool_initialized = 0; + if (inpcb_pool_initialized == 0) { + pool_init(&inpcb_pool, sizeof(struct inpcb), 0, + IPL_SOFTNET, 0, "inpcbpl", NULL); + inpcb_pool_initialized = 1; + } TAILQ_INIT(&table->inpt_queue); table->inpt_hashtbl = hashinit(hashsize, M_PCB, M_NOWAIT, @@ -218,11 +223,6 @@ in_pcballoc(struct socket *so, struct in NET_ASSERT_LOCKED(); - if (inpcb_pool_initialized == 0) { - pool_init(&inpcb_pool, sizeof(struct inpcb), 0, - IPL_SOFTNET, 0, "inpcbpl", NULL); - inpcb_pool_initialized = 1; - } inp = pool_get(&inpcb_pool, PR_NOWAIT|PR_ZERO); if (inp == NULL) return (ENOBUFS);