From 70a89a207f13885a7fdd8bad3af1957fe98b3d4d Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Tue, 21 Oct 2025 05:31:41 +0000 Subject: [PATCH] Fix Auth::User::absorb() IP list transfer logic (#2194) Detach IP from source list before reattaching to destination and decrement ipcount. This prevents list corruption and counter mismatch. --- src/auth/User.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/auth/User.cc b/src/auth/User.cc index 7b274386aa..f1f29738b2 100644 --- a/src/auth/User.cc +++ b/src/auth/User.cc @@ -106,12 +106,13 @@ Auth::User::absorb(Auth::User::Pointer from) } if (!found) { - /* This ip is not in the seen list. Add it. */ - dlinkAddTail(&new_ipdata->node, &ipdata->node, &ip_list); - ++ipcount; /* remove from the source list */ dlinkDelete(&new_ipdata->node, &(from->ip_list)); - ++from->ipcount; + assert(from->ipcount); + --from->ipcount; + /* This ip is not in the seen list. Add it. */ + dlinkAddTail(new_ipdata, &new_ipdata->node, &ip_list); + ++ipcount; } } } -- 2.47.3