Re: [PATCH v2 net] inetpeer: randomize RB-tree node comparison using SipHash
Ido Schimmel <[email protected]>
| Newsgroups | gmane.linux.network |
|---|---|
| Message-ID | <20260816124359.GA62850@shredder> |
On Fri, Aug 14, 2026 at 06:06:16AM +0000, Eric Dumazet wrote:
> @@ -190,12 +221,13 @@ struct inet_peer *inet_getpeer(struct inet_peer_base *base,
> write_seqlock_bh(&base->lock);
>
> gc_cnt = 0;
> - p = lookup(daddr, base, seq, gc_stack, &gc_cnt, &parent, &pp);
> + p = lookup(daddr, dhash, base, seq, gc_stack, &gc_cnt, &parent, &pp);
> if (!p) {
> if ((u64)base->total < 2ULL * READ_ONCE(inet_peer_threshold))
> p = kmem_cache_alloc(peer_cachep, GFP_ATOMIC);
Eric, this is a leftover from v1, so the patch doesn't apply :/
> if (p) {
> p->daddr = *daddr;
> + p->hash = dhash;
> p->dtime = (__u32)jiffies;
> refcount_set(&p->refcnt, 1);
> atomic_set(&p->rid, 0);