From 08c511f1bfbda778cd0eb0e7c0b4fa8cc7c9b8e8 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Tue, 11 Jun 2024 12:43:50 +0200 Subject: [PATCH] enip: remove unnecessary unsafe As the function SCEnipRegisterParsers is already marked as unsafe --- rust/src/enip/enip.rs | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/rust/src/enip/enip.rs b/rust/src/enip/enip.rs index 834e3e2af4f3..30335dec82f3 100644 --- a/rust/src/enip/enip.rs +++ b/rust/src/enip/enip.rs @@ -634,13 +634,11 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() { let _ = AppLayerRegisterParser(&parser, alproto); } SCLogDebug!("Rust enip parser registered for UDP."); - unsafe { - AppLayerParserRegisterParserAcceptableDataDirection( - IPPROTO_UDP, - ALPROTO_ENIP, - STREAM_TOSERVER | STREAM_TOCLIENT, - ); - } + AppLayerParserRegisterParserAcceptableDataDirection( + IPPROTO_UDP, + ALPROTO_ENIP, + STREAM_TOSERVER | STREAM_TOCLIENT, + ); AppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_ENIP); } else { SCLogDebug!("Protocol detector and parser disabled for ENIP on UDP."); @@ -661,13 +659,11 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() { let _ = AppLayerRegisterParser(&parser, alproto); } SCLogDebug!("Rust enip parser registered for TCP."); - unsafe { - AppLayerParserRegisterParserAcceptableDataDirection( - IPPROTO_TCP, - ALPROTO_ENIP, - STREAM_TOSERVER | STREAM_TOCLIENT, - ); - } + AppLayerParserRegisterParserAcceptableDataDirection( + IPPROTO_TCP, + ALPROTO_ENIP, + STREAM_TOSERVER | STREAM_TOCLIENT, + ); AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_ENIP); } else { SCLogDebug!("Protocol detector and parser disabled for ENIP on TCP.");