diff --git a/tap/source/handle_af_packet.go b/tap/source/handle_af_packet.go index 11e29b9d4..2d8ee6847 100644 --- a/tap/source/handle_af_packet.go +++ b/tap/source/handle_af_packet.go @@ -52,7 +52,7 @@ func (h *afPacketHandle) SetBPF(expr string) (err error) { } bpfIns = append(bpfIns, bpfIns2) } - h.capture.SetBPF(bpfIns) + err = h.capture.SetBPF(bpfIns) return } diff --git a/tap/source/handle_pcap.go b/tap/source/handle_pcap.go index 607c61d60..f4f99eddd 100644 --- a/tap/source/handle_pcap.go +++ b/tap/source/handle_pcap.go @@ -9,10 +9,8 @@ import ( ) type pcapHandle struct { - source *gopacket.PacketSource - capture *pcap.Handle - decoder gopacket.Decoder - decodeOptions gopacket.DecodeOptions + source *gopacket.PacketSource + capture *pcap.Handle } func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) { diff --git a/tap/source/tcp_packet_source.go b/tap/source/tcp_packet_source.go index c81b776ff..b27ec6175 100644 --- a/tap/source/tcp_packet_source.go +++ b/tap/source/tcp_packet_source.go @@ -76,7 +76,7 @@ func newTcpPacketSource(name, filename string, interfaceName string, logger.Log.Infof("Using AF_PACKET socket as the capture source") } - decoder := gopacket.DecodersByLayerName[fmt.Sprintf("%s", layers.LinkTypeEthernet)] + decoder := gopacket.DecodersByLayerName[string(layers.LinkTypeEthernet)] result.Handle.SetDecoder(decoder, behaviour.Lazy, true) if behaviour.BpfFilter != "" {