From 5bc3a9d5acd3de680f4093ede2e4844b4fcd1a24 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 2 Sep 2016 20:31:03 +0100 Subject: [PATCH] correctly reverse-resolve source of inbound connections There were two problems: - the renderer was looking for reverse names on the destination - the probe was not annotating source nodes with reverse-resolved names Fixes #1847 --- probe/endpoint/reporter.go | 3 +++ render/detailed/connections.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/probe/endpoint/reporter.go b/probe/endpoint/reporter.go index b765657fa..fb32ede8d 100644 --- a/probe/endpoint/reporter.go +++ b/probe/endpoint/reporter.go @@ -196,6 +196,9 @@ func (r *Reporter) addConnection(rpt *report.Report, t fourTuple, namespaceID st // In case we have a reverse resolution for the IP, we can use it for // the name... + if fromNames, err := r.reverseResolver.get(t.fromAddr); err == nil { + fromNode = fromNode.WithSet(ReverseDNSNames, report.MakeStringSet(fromNames...)) + } if toNames, err := r.reverseResolver.get(t.toAddr); err == nil { toNode = toNode.WithSet(ReverseDNSNames, report.MakeStringSet(toNames...)) } diff --git a/render/detailed/connections.go b/render/detailed/connections.go index b8c7b9ec6..d4ce34f4a 100644 --- a/render/detailed/connections.go +++ b/render/detailed/connections.go @@ -145,7 +145,7 @@ func outgoingConnectionsSummary(topologyID string, r report.Report, n report.Nod if !ok { continue } - key := newConnection(n, node, port, remoteEndpointID, localAddr) + key := newConnection(n, node, port, localEndpoint.ID, localAddr) counts[key] = counts[key] + 1 } }