Fix kext version check

This commit is contained in:
Vladimir Stoilov
2024-03-03 15:21:52 +02:00
parent ddec8010d4
commit b6e0894257
2 changed files with 26 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ func startInterception(packets chan packet.Packet) error {
}
log.Debugf("Kext version: %s", version.String())
if version.Minor < 2 {
if version.Major < 2 {
useOldKext = true
// Transfer ownership.
@@ -104,6 +104,27 @@ func startInterception(packets chan packet.Packet) error {
}
})
// Start kext logging. The worker will periodically send request to the kext to print memory stats.
// module.StartServiceWorker("kext memory stats request worker", 0, func(ctx context.Context) error {
// timer := time.NewTicker(20 * time.Second)
// for {
// select {
// case <-timer.C:
// {
// err := kext2.SendPrintMemoryStatsCommand()
// if err != nil {
// return err
// }
// }
// case <-ctx.Done():
// {
// return nil
// }
// }
// }
// })
}
return nil

View File

@@ -98,6 +98,10 @@ func SendBandwidthStatsRequest() error {
return kext_interface.SendGetBandwidthStatsCommand(kextFile)
}
func SendPrintMemoryStatsCommand() error {
return kext_interface.SendPrintMemoryStatsCommand(kextFile)
}
// RecvVerdictRequest waits for the next verdict request from the kext. If a timeout is reached, both *VerdictRequest and error will be nil.
func RecvVerdictRequest() (*kext_interface.Info, error) {
return kext_interface.RecvInfo(kextFile)