added comments, optimized memory

This commit is contained in:
0xdcarns
2021-12-10 15:01:10 -05:00
parent 85e8c0abb6
commit e45a485bce
17 changed files with 136 additions and 152 deletions

View File

@@ -685,10 +685,14 @@ func isInterfacePresent(iface string, address string) (string, bool) {
for _, addr := range currAddrs {
if strings.Contains(addr.String(), address) && currIface.Name != iface {
logger.Log(2, "found iface", addr.String(), currIface.Name)
interfaces = nil
currAddrs = nil
return currIface.Name, false
}
}
currAddrs = nil
}
interfaces = nil
logger.Log(2, "failed to find iface", iface)
return "", true
}