enip: remove unnecessary unsafe

As the function SCEnipRegisterParsers is already marked as unsafe
pull/11309/head
Philippe Antoine 1 year ago committed by Victor Julien
parent b128a75973
commit 08c511f1bf

@ -634,13 +634,11 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
let _ = AppLayerRegisterParser(&parser, alproto); let _ = AppLayerRegisterParser(&parser, alproto);
} }
SCLogDebug!("Rust enip parser registered for UDP."); SCLogDebug!("Rust enip parser registered for UDP.");
unsafe { AppLayerParserRegisterParserAcceptableDataDirection(
AppLayerParserRegisterParserAcceptableDataDirection( IPPROTO_UDP,
IPPROTO_UDP, ALPROTO_ENIP,
ALPROTO_ENIP, STREAM_TOSERVER | STREAM_TOCLIENT,
STREAM_TOSERVER | STREAM_TOCLIENT, );
);
}
AppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_ENIP); AppLayerParserRegisterLogger(IPPROTO_UDP, ALPROTO_ENIP);
} else { } else {
SCLogDebug!("Protocol detector and parser disabled for ENIP on UDP."); SCLogDebug!("Protocol detector and parser disabled for ENIP on UDP.");
@ -661,13 +659,11 @@ pub unsafe extern "C" fn SCEnipRegisterParsers() {
let _ = AppLayerRegisterParser(&parser, alproto); let _ = AppLayerRegisterParser(&parser, alproto);
} }
SCLogDebug!("Rust enip parser registered for TCP."); SCLogDebug!("Rust enip parser registered for TCP.");
unsafe { AppLayerParserRegisterParserAcceptableDataDirection(
AppLayerParserRegisterParserAcceptableDataDirection( IPPROTO_TCP,
IPPROTO_TCP, ALPROTO_ENIP,
ALPROTO_ENIP, STREAM_TOSERVER | STREAM_TOCLIENT,
STREAM_TOSERVER | STREAM_TOCLIENT, );
);
}
AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_ENIP); AppLayerParserRegisterLogger(IPPROTO_TCP, ALPROTO_ENIP);
} else { } else {
SCLogDebug!("Protocol detector and parser disabled for ENIP on TCP."); SCLogDebug!("Protocol detector and parser disabled for ENIP on TCP.");

Loading…
Cancel
Save