mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
624fed69bb
commit
2c7a8d8fa7
1 changed files with 3 additions and 3 deletions
|
@ -91,9 +91,6 @@ func (q *Queue) trackProtocols(pkt gopacket.Packet) {
|
|||
}
|
||||
|
||||
func (q *Queue) trackActivity(eth *layers.Ethernet, ip4 *layers.IPv4, address net.IP, pktSize uint64) {
|
||||
q.Lock()
|
||||
defer q.Unlock()
|
||||
|
||||
// detrmine direction
|
||||
isSent := bytes.Compare(address, ip4.SrcIP) == 0
|
||||
// push to activity channel
|
||||
|
@ -103,6 +100,9 @@ func (q *Queue) trackActivity(eth *layers.Ethernet, ip4 *layers.IPv4, address ne
|
|||
Source: isSent,
|
||||
}
|
||||
|
||||
q.Lock()
|
||||
defer q.Unlock()
|
||||
|
||||
// initialize or update stats
|
||||
addr := address.String()
|
||||
if _, found := q.Traffic[addr]; found == false {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue