From a6739e79882517d0153ef12b93dc9ac9a462466d Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Mon, 11 Sep 2023 16:56:51 -0400 Subject: [PATCH] net/netns: add logs to getInterfaceIndex too Change-Id: Ia0f5f188633eaac2d396d1cebe322b3aa0ceb484 --- net/netns/netns_darwin.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/netns/netns_darwin.go b/net/netns/netns_darwin.go index 586e2d918..3a5e499f2 100644 --- a/net/netns/netns_darwin.go +++ b/net/netns/netns_darwin.go @@ -58,7 +58,12 @@ func controlLogf(logf logger.Logf, netMon *netmon.Monitor, network, address stri return bindConnToInterface(c, network, address, idx, logf) } -func getInterfaceIndex(logf logger.Logf, netMon *netmon.Monitor, address string) (int, error) { +func getInterfaceIndex(logf logger.Logf, netMon *netmon.Monitor, address string) (retIf int, retErr error) { + logf("getInterfaceIndex(%q) called", address) + defer func() { + logf("getInterfaceIndex(%q) = (%d, %v)", address, retIf, retErr) + }() + // Helper so we can log errors. defaultIdx := func() (int, error) { if netMon == nil {