ok mvs@
> On 4 Mar 2022, at 18:32, Alexander Bluhm <[email protected]> wrote:
>
> Hi,
>
> in_pcbinit() is called during boot. There malloc(9) cannot fail.
> If called with M_WAITOK it would panic otherwise. So this error
> handling is needles.
>
> ok?
>
> bluhm
>
> Index: netinet/in_pcb.c
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/in_pcb.c,v
> retrieving revision 1.258
> diff -u -p -r1.258 in_pcb.c
> --- netinet/in_pcb.c 2 Mar 2022 21:30:58 -0000 1.258
> +++ netinet/in_pcb.c 4 Mar 2022 15:28:05 -0000
> @@ -175,14 +175,10 @@ in_pcbinit(struct inpcbtable *table, int
> {
>
> TAILQ_INIT(&table->inpt_queue);
> - table->inpt_hashtbl = hashinit(hashsize, M_PCB, M_NOWAIT,
> + table->inpt_hashtbl = hashinit(hashsize, M_PCB, M_WAITOK,
> &table->inpt_mask);
> - if (table->inpt_hashtbl == NULL)
> - panic("in_pcbinit: hashinit failed");
> - table->inpt_lhashtbl = hashinit(hashsize, M_PCB, M_NOWAIT,
> + table->inpt_lhashtbl = hashinit(hashsize, M_PCB, M_WAITOK,
> &table->inpt_lmask);
> - if (table->inpt_lhashtbl == NULL)
> - panic("in_pcbinit: hashinit failed for lport");
> table->inpt_count = 0;
> table->inpt_size = hashsize;
> arc4random_buf(&table->inpt_key, sizeof(table->inpt_key));
>