mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-25 03:36:41 +00:00
On macOS, routes from a previous session can survive across sleep/wake cycles even though cleanup reports success. When the new engine instance tries to add the same route, it fails with "file exists" (EEXIST), leaving the route untracked by the route manager while the OS still has it pointing at a stale interface. Handle this by detecting EEXIST on RTM_ADD, removing the stale route, and retrying. This matches how Linux silently handles existing routes via netlink.