From 03545d674ffd7e05ec84b1da45406a1c8264df00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Serv=C3=A9n=20Mar=C3=ADn?= Date: Sat, 30 Jan 2021 20:09:50 +0100 Subject: [PATCH] pkg/mesh: don't shadow privIface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a bug where the variable holding the index of the private interface was shadowed, causing it to always be "0". Signed-off-by: Lucas Servén Marín --- pkg/mesh/mesh.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mesh/mesh.go b/pkg/mesh/mesh.go index 3e537dd..5ae8f17 100644 --- a/pkg/mesh/mesh.go +++ b/pkg/mesh/mesh.go @@ -131,7 +131,7 @@ func New(backend Backend, enc encapsulation.Encapsulator, granularity Granularit if err != nil { return nil, fmt.Errorf("failed to find interface for private IP: %v", err) } - privIface := ifaces[0].Index + privIface = ifaces[0].Index if enc.Strategy() != encapsulation.Never { if err := enc.Init(privIface); err != nil { return nil, fmt.Errorf("failed to initialize encapsulator: %v", err)