Resolve client identity from complete UniFi data - #1094
Conversation
|
@Jason-Morcos do you have a concrete example of this happening? I haven't seen this one in the wild, even after adding the enhancements recently that resolve VPN/Tailscale/Teleport IPs on Client Performance. Just curious what triggered the investigation and if I can repro it on one of my sites. |
|
Thanks - yes. I was having an issue with some of my devices getting identified when trying to do LAN speed tests. The first concrete case was a normal local iPhone (my iPhone). NetworkOptimizer received its actual LAN IPv4 address, but the available UniFi record had no current The case that current main still misses was a local, dual-stack Mac connected through both dock Ethernet and Wi-Fi:
On the unpatched path, This is separate from the VPN/Tailscale/Teleport enhancement. Those addresses intentionally receive a synthetic VPN identity because they are not ordinary UniFi LAN clients. This case is an ordinary local client that UniFi knows, but whose identity is split across legacy client data, v2 active data, and—for IPv6—the gateway neighbor table. A minimal fixture reproduction would be:
For the IPv6 variant, use a local IPv6 request address, a gateway neighbor row mapping it to the client MAC, and a v2 active record with that MAC. The focused tests in the PR model both shapes. (I previously basically was running this code locally and had scripted up a way to patch every new NetworkOptimizer release to keep this fix in place) |
a42af7f to
836d56e
Compare
Problem
UniFi's legacy
stat/staresponses can omit a usable IP—or the client entirely—for devices behind newer UniFi bridges and consoles. The v2 active/history endpoints can still carry the address, while an IPv6 address may only be recoverable by joining the gateway neighbor table to the active client's MAC.The Client Performance page currently treats those clients as unidentified even though the controller has enough data to resolve them.
Fix
stat/staomits the clientValidation
NetworkOptimizer.Web.Tests: 1,291 passedThe validation used fixtures only; it made no controller, gateway, client, or network changes.