Linux netlink and route setting... work in progress.
This commit is contained in:
parent
6c5a097711
commit
e8be28734b
3 changed files with 44 additions and 31 deletions
|
@ -1989,7 +1989,6 @@ public:
|
|||
SharedPtr<ManagedRoute> &mr = n.managedRoutes[*target];
|
||||
if (!mr)
|
||||
mr.set(new ManagedRoute(*target, *via, *src, tapdev.c_str()));
|
||||
mr->sync();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1998,6 +1997,18 @@ public:
|
|||
n.managedRoutes.erase(r++);
|
||||
else ++r;
|
||||
}
|
||||
|
||||
// Sync device-local managed routes first, then indirect results. That way
|
||||
// we don't get destination unreachable for routes that are via things
|
||||
// that do not yet have routes in the system.
|
||||
for(std::map< InetAddress, SharedPtr<ManagedRoute> >::iterator r(n.managedRoutes.begin());r!=n.managedRoutes.end();++r) {
|
||||
if (!r->second->via())
|
||||
r->second->sync();
|
||||
}
|
||||
for(std::map< InetAddress, SharedPtr<ManagedRoute> >::iterator r(n.managedRoutes.begin());r!=n.managedRoutes.end();++r) {
|
||||
if (r->second->via())
|
||||
r->second->sync();
|
||||
}
|
||||
}
|
||||
|
||||
if (syncDns) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue