parent
24759c92ad
commit
5bd8c33a6d
22 changed files with 319 additions and 172 deletions
|
@ -95,6 +95,11 @@ void MacosRouteMonitor::handleRtmDelete(const struct rt_msghdr* rtm,
|
|||
!(rtm->rtm_addrs & RTA_NETMASK) || (addrlist.count() < 3)) {
|
||||
return;
|
||||
}
|
||||
// Ignore interface-scoped routes, we want to find the default route to the
|
||||
// internet in the global scope.
|
||||
if (rtm->rtm_flags & RTF_IFSCOPE) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for a default route, which should have a netmask of zero.
|
||||
const struct sockaddr* sa =
|
||||
|
@ -156,6 +161,11 @@ void MacosRouteMonitor::handleRtmUpdate(const struct rt_msghdr* rtm,
|
|||
!(rtm->rtm_addrs & RTA_NETMASK) || (addrlist.count() < 3)) {
|
||||
return;
|
||||
}
|
||||
// Ignore interface-scoped routes, we want to find the default route to the
|
||||
// internet in the global scope.
|
||||
if (rtm->rtm_flags & RTF_IFSCOPE) {
|
||||
return;
|
||||
}
|
||||
// Ignore route changes that we caused, or routes on the tunnel interface.
|
||||
if (rtm->rtm_index == m_ifindex) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue