[windows_kext] Add check for previously injected packets in the ALE layer

This commit is contained in:
Vladimir Stoilov
2024-06-12 18:06:42 +03:00
parent 866aef1857
commit db49f9a32d
3 changed files with 18 additions and 1 deletions

View File

@@ -164,6 +164,7 @@ impl Device {
crate::connection::Verdict::RedirectNameServer
| crate::connection::Verdict::RedirectTunnel => {
if let Some(redirect_info) = redirect_info {
// Will not redirect packets from ALE layer
if let Err(err) = packet.redirect(redirect_info) {
err!("failed to redirect packet: {}", err);
}
@@ -173,6 +174,8 @@ impl Device {
}
}
_ => {
// Inject only ALE layer. This will trigger proper block/drop.
// Packet layer just drop the packet.
if let Err(err) = self.inject_packet(packet, true) {
err!("failed to inject packet: {}", err);
}