mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
fix: keep VPN routing on macOS when switching between WG/AWG tunnels
This commit is contained in:
@@ -435,7 +435,15 @@ bool MacosRouteMonitor::rtmSendRoute(int action, const IPAddress& prefix,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((action == RTM_ADD) && (errno == EEXIST)) {
|
if ((action == RTM_ADD) && (errno == EEXIST)) {
|
||||||
return true;
|
rtm->rtm_type = RTM_DELETE;
|
||||||
|
rtm->rtm_seq = m_rtseq++;
|
||||||
|
write(m_rtsock, rtm, rtm->rtm_msglen);
|
||||||
|
rtm->rtm_type = RTM_ADD;
|
||||||
|
rtm->rtm_seq = m_rtseq++;
|
||||||
|
len = write(m_rtsock, rtm, rtm->rtm_msglen);
|
||||||
|
if (len == rtm->rtm_msglen) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ((action == RTM_DELETE) && (errno == ESRCH)) {
|
if ((action == RTM_DELETE) && (errno == ESRCH)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user