From 3ebe4a5303a922ffa03edb7ef6f0d833e53bdb14 Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Fri, 2 Sep 2016 08:19:32 +0100 Subject: [PATCH] cosmetic: formatting --- probe/endpoint/nat.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/probe/endpoint/nat.go b/probe/endpoint/nat.go index b2c6ffe72..88c9e8d69 100644 --- a/probe/endpoint/nat.go +++ b/probe/endpoint/nat.go @@ -50,13 +50,14 @@ func toMapping(f flow) *endpointMapping { // the NAT table. func (n natMapper) applyNAT(rpt report.Report, scope string) { n.flowWalker.walkFlows(func(f flow) { - var ( - mapping = toMapping(f) - realEndpointID = report.MakeEndpointNodeID(scope, "", mapping.originalIP, strconv.Itoa(mapping.originalPort)) - copyEndpointPort = strconv.Itoa(mapping.rewrittenPort) - copyEndpointID = report.MakeEndpointNodeID(scope, "", mapping.rewrittenIP, copyEndpointPort) - node, ok = rpt.Endpoint.Nodes[realEndpointID] - ) + mapping := toMapping(f) + + realEndpointPort := strconv.Itoa(mapping.originalPort) + copyEndpointPort := strconv.Itoa(mapping.rewrittenPort) + realEndpointID := report.MakeEndpointNodeID(scope, "", mapping.originalIP, realEndpointPort) + copyEndpointID := report.MakeEndpointNodeID(scope, "", mapping.rewrittenIP, copyEndpointPort) + + node, ok := rpt.Endpoint.Nodes[realEndpointID] if !ok { return } @@ -66,6 +67,5 @@ func (n natMapper) applyNAT(rpt report.Report, scope string) { Port: copyEndpointPort, "copy_of": realEndpointID, })) - }) }