From 1fb2c285f45d4b4c9581a375764f32b1aeabc1fa Mon Sep 17 00:00:00 2001 From: Romain Malmain Date: Thu, 3 Oct 2024 20:26:28 +0200 Subject: [PATCH] Discard no tc mm (follow-up) (#2584) * forgot to set the flags --- .../broker_hooks/centralized_multi_machine.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libafl/src/events/broker_hooks/centralized_multi_machine.rs b/libafl/src/events/broker_hooks/centralized_multi_machine.rs index 0137a7e887c..0630f135727 100644 --- a/libafl/src/events/broker_hooks/centralized_multi_machine.rs +++ b/libafl/src/events/broker_hooks/centralized_multi_machine.rs @@ -9,7 +9,7 @@ use std::{ #[cfg(feature = "llmp_compression")] use libafl_bolts::llmp::LLMP_FLAG_COMPRESSED; use libafl_bolts::{ - llmp::{Flags, LlmpBrokerInner, LlmpHook, LlmpMsgHookResult, Tag}, + llmp::{Flags, LlmpBrokerInner, LlmpHook, LlmpMsgHookResult, Tag, LLMP_FLAG_FROM_MM}, ownedref::OwnedRef, shmem::ShMemProvider, ClientId, Error, @@ -255,20 +255,22 @@ where let msg = msg.into_owned().unwrap().into_vec(); #[cfg(feature = "llmp_compression")] match state_wr_lock.compressor().maybe_compress(msg.as_ref()) { - Some(comp_buf) => { - Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_COMPRESSED, comp_buf)) - } - None => Ok((_LLMP_TAG_TO_MAIN, Flags(0), msg)), + Some(comp_buf) => Ok(( + _LLMP_TAG_TO_MAIN, + LLMP_FLAG_COMPRESSED | LLMP_FLAG_FROM_MM, + comp_buf, + )), + None => Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_FROM_MM, msg)), } #[cfg(not(feature = "llmp_compression"))] - Ok((_LLMP_TAG_TO_MAIN, Flags(0), msg)) + Ok((_LLMP_TAG_TO_MAIN, LLMP_FLAG_FROM_MM, msg)) } MultiMachineMsg::Event(evt) => { let evt = evt.into_owned().unwrap(); let (inner_flags, buf) = Self::try_compress(&mut state_wr_lock, evt.as_ref())?; - Ok((_LLMP_TAG_TO_MAIN, inner_flags, buf)) + Ok((_LLMP_TAG_TO_MAIN, inner_flags | LLMP_FLAG_FROM_MM, buf)) } }) .collect();