Hi, On Mon, Dec 12, 2022 at 01:50:51PM +0100, Arne Schwabe wrote: > > I am not too much into FreeBSD parts, but > > > >> + hash_iterator_init(m->hash, &hi); > >> + > >> + while ((he = hash_iterator_next(&hi))) > >> + { > >> + struct multi_instance *mi = (struct multi_instance *) he->value; > >> + > >> + if (mi->context.c2.tls_multi->peer_id != peerid) > >> + continue; > > > > Shouldn't we use m->instances[peerid] instead of iterating over m->hash? > > Yes and a check that kernel does not give something > max_peer
I agree, doing the iterator here for every single active peer when we already have the array. But then, of course, p2p peer-id will be "something random", not constrained by max-clients. Anyway, we have a procedural problem here - kp@ is on vacation for a few weeks now, so we won't see a v2 of this patch any time soon. Do you think the patch is ready to be merged, "as is", with not-so-good efficiency? One of you could then send a followup patch changing this to use the array accessor. gert -- "If was one thing all people took for granted, was conviction that if you feed honest figures into a computer, honest figures come out. Never doubted it myself till I met a computer with a sense of humor." Robert A. Heinlein, The Moon is a Harsh Mistress Gert Doering - Munich, Germany g...@greenie.muc.de
signature.asc
Description: PGP signature
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel