Fix kext version check
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user