Restore copying nodes when obtaining connection summaries

This commit is contained in:
Alfonso Acosta
2016-08-02 11:08:24 +00:00
parent 1091225bf6
commit bdd09d8aa9

View File

@@ -75,6 +75,9 @@ func incomingConnectionsSummary(topologyID string, r report.Report, n report.Nod
if !node.Adjacency.Contains(n.ID) {
continue
}
// Shallow-copy the node to obtain a different pointer
// on the remote side
remoteNode := node
// Work out what port they are talking to, and count the number of
// connections to that port.
@@ -90,7 +93,7 @@ func incomingConnectionsSummary(topologyID string, r report.Report, n report.Nod
}
key := connection{
localNode: &n,
remoteNode: &node,
remoteNode: &remoteNode,
port: port,
}
if isInternetNode(n) {
@@ -126,8 +129,13 @@ func outgoingConnectionsSummary(topologyID string, r report.Report, n report.Nod
if !ok {
continue
}
remoteEndpointIDs := endpointChildIDsOf(node)
// Shallow-copy the node to obtain a different pointer
// on the remote side
remoteNode := node
for _, localEndpoint := range localEndpoints {
_, localAddr, _, ok := report.ParseEndpointNodeID(localEndpoint.ID)
if !ok {
@@ -141,7 +149,7 @@ func outgoingConnectionsSummary(topologyID string, r report.Report, n report.Nod
}
key := connection{
localNode: &n,
remoteNode: &node,
remoteNode: &remoteNode,
port: port,
}
if isInternetNode(n) {