From b502742db7fe7e3397e38b0a9f4a6c5e47ede7f6 Mon Sep 17 00:00:00 2001 From: Shivani Bhardwaj Date: Tue, 22 Sep 2026 12:29:41 +0530 Subject: [PATCH] datasets: accept standard IPv4 notation for ip type The internal type set for datasets of type IP is IPv6, however, the expectation is that it'll support IPv6, standard IPv4 as well as IPv4 in IPv6 notation. A regression happened during the conversion of datasets parsing to rust wherein standard IPv4 was rejected with IP type. Fix that by handling IPv4 standard notation in IPv6 handler. Fixes: bc79300dfa ("datasets: move initial file reading to rust") Ticket: 9006 (cherry picked from commit 8b379a3b04d9082e82d64dba9ac84a1dafa67eff) --- rust/src/detect/datasets.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rust/src/detect/datasets.rs b/rust/src/detect/datasets.rs index 2f37b554e1..6b0f6e11c6 100644 --- a/rust/src/detect/datasets.rs +++ b/rust/src/detect/datasets.rs @@ -247,10 +247,13 @@ unsafe fn process_ipv6_set( ) -> i32 { let ipv6 = match Ipv6Addr::from_str(v[0]) { Ok(a) => a, - Err(_) => { - SCFatalErrorOnInit!("invalid Ipv6 value {} in {}", set_name, filename.display()); - return -1; - } + Err(_) => match Ipv4Addr::from_str(v[0]) { + Ok(a) => a.to_ipv6_mapped(), + Err(_) => { + SCFatalErrorOnInit!("invalid Ipv6 value {} in {}", set_name, filename.display()); + return -1; + } + }, }; let mut fin_ipv6 = ipv6;