Files
netbird/client/netevents
Zoltan Papp 1f1bccb674 [client] Serialize availability transitions in the netevents manager
SetNetworkAvailable read IsOnline before updating netState without any
locking, so concurrent availability flips could interleave: a false call
could observe a stale offline state, skip MarkNetworkChange, and land
after a racing true call, leaving the client offline with unswept
connections. The netState and recorder updates could also apply out of
order, letting the listener state disagree with netState. On Android the
initial availability push at service start races the ConnectivityManager
callbacks, and iOS feeds the same manager from NWPathMonitor.

Hold a manager mutex across the check, sweep mark, state update and
recorder update so transitions apply atomically and in order.
2026-08-24 21:58:04 +02:00
..