mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 05:23:19 -07:00
balls
This commit is contained in:
parent
6e6eb688d7
commit
1cffa33264
7 changed files with 74 additions and 75 deletions
14
net/arp.go
14
net/arp.go
|
@ -8,9 +8,9 @@ import (
|
|||
type ArpTable map[string]string
|
||||
|
||||
var (
|
||||
arp_parsed = false
|
||||
arp_lock = &sync.Mutex{}
|
||||
arp_table = make(ArpTable)
|
||||
arpWasParsed = false
|
||||
arpLock = &sync.Mutex{}
|
||||
arpTable = make(ArpTable)
|
||||
)
|
||||
|
||||
func ArpDiff(current, before ArpTable) ArpTable {
|
||||
|
@ -34,7 +34,7 @@ func ArpLookup(iface string, address string, refresh bool) (string, error) {
|
|||
}
|
||||
|
||||
// Lookup the hardware address of this ip.
|
||||
if mac, found := arp_table[address]; found == true {
|
||||
if mac, found := arpTable[address]; found == true {
|
||||
return mac, nil
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ func ArpLookup(iface string, address string, refresh bool) (string, error) {
|
|||
}
|
||||
|
||||
func ArpParsed() bool {
|
||||
arp_lock.Lock()
|
||||
defer arp_lock.Unlock()
|
||||
return arp_parsed
|
||||
arpLock.Lock()
|
||||
defer arpLock.Unlock()
|
||||
return arpWasParsed
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue