mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-12 17:59:06 +02:00
A self-addressed bootstrap stores the hostname as proxy_address, which is exactly what a proxy registration is refused on when another account holds it there. It asked nobody whether it could: the domain unique index arbitrated between pins, and a foreign proxy already declaring the host was never consulted, before or after the insert. Any account could therefore pin an endpoint onto a host another account's proxy serves — owning nothing — and lock that proxy out on its next reconnect, and a proxy racing such a pin could end with both claims standing, since only the labeled path re-read ownership after its write. The self-addressed path now asks HasForeignAccountProxyAtHost before the insert and confirmGatewayClusterOwnership after it, the same as the labeled one. Address-first stays intact: only a row owned by a different account refuses, so pinning ahead of any proxy, or onto the account's own, is unchanged. Also pins the bootstrap side's failure paths — an ownership re-read that cannot answer leaves no pin behind and surfaces the store's error, and a withdrawal that fails still reports the claim as lost — and shortens the helper's comment to point at the shared argument on proxy.ErrClusterAddressUnavailable rather than restate it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sa3DsBDP3VciAi4PPG17L6