mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-15 07:05:27 +00:00
Fix linter errors
This commit is contained in:
parent
8039970116
commit
82f8f6f20f
@ -52,7 +52,7 @@ func (h *afPacketHandle) SetBPF(expr string) (err error) {
|
|||||||
}
|
}
|
||||||
bpfIns = append(bpfIns, bpfIns2)
|
bpfIns = append(bpfIns, bpfIns2)
|
||||||
}
|
}
|
||||||
h.capture.SetBPF(bpfIns)
|
err = h.capture.SetBPF(bpfIns)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@ import (
|
|||||||
type pcapHandle struct {
|
type pcapHandle struct {
|
||||||
source *gopacket.PacketSource
|
source *gopacket.PacketSource
|
||||||
capture *pcap.Handle
|
capture *pcap.Handle
|
||||||
decoder gopacket.Decoder
|
|
||||||
decodeOptions gopacket.DecodeOptions
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) {
|
func (h *pcapHandle) NextPacket() (packet gopacket.Packet, err error) {
|
||||||
|
@ -76,7 +76,7 @@ func newTcpPacketSource(name, filename string, interfaceName string,
|
|||||||
logger.Log.Infof("Using AF_PACKET socket as the capture source")
|
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)
|
result.Handle.SetDecoder(decoder, behaviour.Lazy, true)
|
||||||
|
|
||||||
if behaviour.BpfFilter != "" {
|
if behaviour.BpfFilter != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user