]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
enip: remove unnecessary unsafe
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 11 Jun 2024 10:43:50 +0000 (12:43 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 15 Jun 2024 13:43:32 +0000 (15:43 +0200)
As the function SCEnipRegisterParsers is already marked as unsafe

rust/src/enip/enip.rs

index 834e3e2af4f3a70506dca62b71cc179ba2055fa9..30335dec82f32277c1be6c921b2aa1690857e98b 100644 (file)
@@ -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.");