Skip to content

Commit

Permalink
enip: remove unnecessary unsafe
Browse files Browse the repository at this point in the history
As the function SCEnipRegisterParsers is already marked as unsafe
  • Loading branch information
catenacyber authored and victorjulien committed Jun 15, 2024
1 parent b128a75 commit 08c511f
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions rust/src/enip/enip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand All @@ -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.");
Expand Down

0 comments on commit 08c511f

Please sign in to comment.