diff --git a/cmd/root.go b/cmd/root.go index 136f456..79078ea 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -183,7 +183,7 @@ type cliConfigIO struct { } type cliConfigReplay struct { - Realtime bool `mapstructure:"realtime"` + Realtime bool `mapstructure:"realtime"` } type cliConfigWorkers struct { @@ -212,8 +212,8 @@ func (c *cliConfig) fillIO(config *engine.Config) error { // Setup IO for pcap file replay logger.Info("replaying from pcap file", zap.String("pcap file", pcapFile)) ioImpl, err = io.NewPcapPacketIO(io.PcapPacketIOConfig{ - PcapFile: pcapFile, - Realtime: c.Replay.Realtime, + PcapFile: pcapFile, + Realtime: c.Replay.Realtime, }) } else { // Setup IO for nfqueue diff --git a/io/pcap.go b/io/pcap.go index c2dfae0..520da17 100644 --- a/io/pcap.go +++ b/io/pcap.go @@ -20,17 +20,16 @@ type pcapPacketIO struct { ioCancel context.CancelFunc config PcapPacketIOConfig - dialer *net.Dialer + dialer *net.Dialer } type PcapPacketIOConfig struct { - PcapFile string - Realtime bool + PcapFile string + Realtime bool } func NewPcapPacketIO(config PcapPacketIOConfig) (PacketIO, error) { handle, err := pcap.OpenOffline(config.PcapFile) - if err != nil { return nil, err }