Allow weight to be assigned to Subnets.
Tinc allows multiple nodes to own the same Subnet, but did not have a sensible way to decide which one to send packets to. Tinc also did not check the reachability of nodes when deciding where to route packets to, so it would not automatically fail over to a reachable node. Tinc now assigns a weight to each Subnet. The default weight is 10, with lower weights having higher priority. The Subnets are now internally sorted in the same way as the kernel's routing table, and the Subnets are search linearly, skipping those of unreachable nodes. A small cache of recently used addresses is used to speed up the lookup functions.
This commit is contained in:
parent
76a1bcaffc
commit
5674bba5c5
5 changed files with 148 additions and 67 deletions
|
|
@ -313,6 +313,7 @@ void sssp_bfs(void)
|
|||
|
||||
void graph(void)
|
||||
{
|
||||
subnet_cache_flush();
|
||||
sssp_bfs();
|
||||
mst_kruskal();
|
||||
graph_changed = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue