net/netns: add logs to getInterfaceIndex too

Change-Id: Ia0f5f188633eaac2d396d1cebe322b3aa0ceb484
This commit is contained in:
Andrew Dunham 2023-09-11 16:56:51 -04:00
parent 9bc611b129
commit a6739e7988

View File

@ -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 {