From 5bd38b10b49ec6446560d0da3ce67beaed69f68e Mon Sep 17 00:00:00 2001
From: David Anderson <danderson@tailscale.com>
Date: Thu, 6 May 2021 14:46:56 -0700
Subject: [PATCH] net/dns: log the correct error when NM Reapply fails.

Found while debugging #1870.

Signed-off-by: David Anderson <danderson@tailscale.com>
---
 net/dns/nm.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/dns/nm.go b/net/dns/nm.go
index 811c4f2c2..29f0f2205 100644
--- a/net/dns/nm.go
+++ b/net/dns/nm.go
@@ -260,7 +260,7 @@ func (m *nmManager) trySet(ctx context.Context, config OSConfig) error {
 	}
 
 	if call := device.CallWithContext(ctx, "org.freedesktop.NetworkManager.Device.Reapply", 0, settings, version, uint32(0)); call.Err != nil {
-		return fmt.Errorf("reapply: %w", err)
+		return fmt.Errorf("reapply: %w", call.Err)
 	}
 
 	return nil