Skip to content

Commit

Permalink
Show at least a second packet
Browse files Browse the repository at this point in the history
  • Loading branch information
tstromberg committed Mar 11, 2022
1 parent 17636e4 commit 655489e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/creds-packet-sniffer-root/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ func PacketSniffer() error {

source := gopacket.NewPacketSource(handler, handler.LinkType())
log.Printf("iterating over packets ...")
packets := 0
for p := range source.Packets() {
log.Printf("got packet: %+v", p)
return nil
packets++
if packets >= 2 {
break
}
}
return nil
}

0 comments on commit 655489e

Please sign in to comment.