Don't use a nil FlowOp to mean "discard the packet"
This commit is contained in:
1 parent
b36ffe1c9d
commit
e702234fdc
6 files changed
+54
-28
No files matched your search
+3
-1
@@ -9,6 +9,8 @@ import (
|
||||
)
|
||||
|
||||
type Pcap struct {
|
||||
NonDiscardingFlowOp
|
||||
|
||||
iface *net.Interface
|
||||
bufSz int
|
||||
|
||||
@@ -131,7 +133,7 @@ func (p *Pcap) sniff(readHandle *pcap.Handle, consumer BridgeConsumer) {
|
||||
continue
|
||||
}
|
||||
|
||||
if fop := consumer(dec.PacketKey()); fop != nil {
|
||||
if fop := consumer(dec.PacketKey()); !fop.Discards() {
|
||||
// We are handing over the frame to
|
||||
// forwarders, so we need to make a copy of it
|
||||
// in order to prevent the next capture from
|
||||
|
||||
Reference in new issue
Block a user