KCC: intrasite graph only uses local DSAs
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 18 Mar 2015 23:06:36 +0000 (12:06 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 29 May 2015 04:58:26 +0000 (06:58 +0200)
In the specs this is implied by the special definition of 'implies'.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/bin/samba_kcc

index 280ca72e21ba4355e07941e15e5bbe0806c532bd..cebfca999d71854aa9e0de3d27788a3b8aaf66de 100755 (executable)
@@ -2209,11 +2209,13 @@ class KCC(object):
         # from rj of R to ri such that j != i, an edge from rj to ri
         # is not already in the graph, and the total edges directed
         # to ri is less than n+2, the KCC adds that edge to the graph.
-        i = 0
-        while i < r_len:
-            dsa = self.my_site.dsa_table[graph_list[i].dsa_dnstr]
-            graph_list[i].add_edges_from_connections(dsa)
-            i = i + 1
+        for vertex in graph_list:
+            dsa = self.my_site.dsa_table[vertex.dsa_dnstr]
+            for dnstr, connect in dsa.connect_table.items():
+                remote = connect.from_dnstr
+                if remote in self.my_site.dsa_table:
+                    vertex.add_edge_from(remote)
+
         DEBUG('reps are:  %s' % '   '.join(x.rep_dsa_dnstr for x in r_list))
         DEBUG('dsas are:  %s' % '   '.join(x.dsa_dnstr for x in graph_list))