From 52ba9b8ee144706e855c11788b67fbf9d278d849 Mon Sep 17 00:00:00 2001 From: JIN Jie Date: Fri, 1 Nov 2024 14:40:01 +0800 Subject: [PATCH] fix: Invalid type in config cause parse failure --- agent/src/config/config.rs | 8 ++++---- agent/src/config/handler.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/agent/src/config/config.rs b/agent/src/config/config.rs index cd10b5df1a9..f17ad646d00 100644 --- a/agent/src/config/config.rs +++ b/agent/src/config/config.rs @@ -2177,8 +2177,8 @@ impl Default for Socket { #[derive(Clone, Debug, Deserialize, PartialEq, Eq)] #[serde(default)] pub struct FlowLogFilters { - pub l4_capture_network_types: Vec, - pub l7_capture_network_types: Vec, + pub l4_capture_network_types: Vec, + pub l7_capture_network_types: Vec, pub l4_ignored_observation_points: Vec, pub l7_ignored_observation_points: Vec, } @@ -2886,12 +2886,12 @@ impl From<&RuntimeConfig> for UserConfig { l4_capture_network_types: rc .l4_log_store_tap_types .iter() - .map(|t| *t as u16) + .map(|t| *t as i16) .collect(), l7_capture_network_types: rc .l7_log_store_tap_types .iter() - .map(|t| *t as u16) + .map(|t| *t as i16) .collect(), l4_ignored_observation_points: rc .l4_log_ignore_tap_sides diff --git a/agent/src/config/handler.rs b/agent/src/config/handler.rs index 707df20f2ec..dfd36432b9a 100755 --- a/agent/src/config/handler.rs +++ b/agent/src/config/handler.rs @@ -2007,7 +2007,7 @@ impl TryFrom<(Config, UserConfig, DynamicConfig)> for ModuleConfig { .l7_capture_network_types .iter() { - if t >= u16::from(CaptureNetworkType::Max) { + if t >= u16::from(CaptureNetworkType::Max) as i16 { warn!("invalid tap type: {}", t); } else { tap_types[t as usize] = true;