Don't use a nil FlowOp to mean "discard the packet"

This commit is contained in:
David Wragg committed 2015-10-14 13:53:34 +01:00
1 parent b36ffe1c9d
commit e702234fdc
6 files changed
+54 -28

No files matched your search

+3 -1
View File
@@ -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