Fix windowskext linter errors

This commit is contained in:
Daniel
2020-04-10 13:18:37 +02:00
parent ddc01e648f
commit fd4f059ebb
5 changed files with 29 additions and 29 deletions

View File

@@ -32,7 +32,7 @@ func main() {
}
// logging
log.Start()
_ = log.Start()
log.Info("starting Portmaster Windows Kext Test Program")
// init
@@ -52,7 +52,7 @@ func main() {
go handlePackets()
// catch interrupt for clean shutdown
signalCh := make(chan os.Signal)
signalCh := make(chan os.Signal, 1)
signal.Notify(
signalCh,
os.Interrupt,
@@ -98,13 +98,19 @@ func handlePackets() {
// reroute dns requests to nameserver
if pkt.IsOutbound() && !pkt.Info().Src.Equal(pkt.Info().Dst) && pkt.Info().DstPort == 53 {
log.Infof("rerouting %s", pkt)
pkt.RerouteToNameserver()
err = pkt.RerouteToNameserver()
if err != nil {
log.Errorf("failed to reroute: %s", err)
}
continue
}
// accept all
log.Infof("accepting %s", pkt)
pkt.PermanentAccept()
err = pkt.PermanentAccept()
if err != nil {
log.Errorf("failed to accept: %s", err)
}
}
}