Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applayer/ftp: Post-merge fixups #12687

Merged
merged 3 commits into from
Feb 28, 2025
Merged

applayer/ftp: Post-merge fixups #12687

merged 3 commits into from
Feb 28, 2025

Conversation

jlucovsky
Copy link
Contributor

Post merge fixups of FTP to Rust conversion

Link to ticket: https://redmine.openinfosecfoundation.org/issues/4082

Describe changes:

  • Use correct values for enums tracking FTP Data state
  • Move MPM declaration to centralized location for use by other Rust modules
  • Minor fixups to remove dead_code directive, proper value for init.

Provide values to any of the below to override the defaults.

  • To use an LibHTP, Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=
SU_REPO=
SU_BRANCH=
LIBHTP_REPO=
LIBHTP_BRANCH=

Issue: 4082

Fixup the incorrect state values -- they should be the default enum
values to match the pre-Rust implementation.
This commit moves the MPM fn declaration into core.rs making it
available for other Rust modules.

Issue: 4082
Issue: 4082

Small fixups.
@jlucovsky jlucovsky requested a review from jasonish as a code owner February 27, 2025 16:51
Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.71%. Comparing base (0dc5b72) to head (9b088ed).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12687      +/-   ##
==========================================
- Coverage   80.71%   80.71%   -0.01%     
==========================================
  Files         936      936              
  Lines      259425   259425              
==========================================
- Hits       209399   209382      -17     
- Misses      50026    50043      +17     
Flag Coverage Δ
fuzzcorpus 56.96% <100.00%> (ø)
livemode 19.41% <0.00%> (-0.01%) ⬇️
pcap 44.21% <100.00%> (+0.01%) ⬆️
suricata-verify 63.51% <100.00%> (-0.01%) ⬇️
unittests 58.20% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -161,7 +160,7 @@ impl Default for FtpTransferCmd {
file_name: std::ptr::null_mut(),
file_len: 0,
direction: 0,
cmd: FtpStateValues::FTP_STATE_NONE as u8,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this changed? It seems a named value is clearer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an incorrect value -- it's expected to be a command enum ... not a state value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be FTP_COMMAND_UNKNOWN then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? It's always initialized before use -- the current code calloc's the memory for this struct which is why I used 0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok lets leave as-is

@suricata-qa
Copy link

WARNING:

field baseline test %
SURI_TLPR1_stats_chk
.uptime 637 607 95.29%

Pipeline 24929

@victorjulien victorjulien added this to the 8.0 milestone Feb 28, 2025
@victorjulien victorjulien merged commit 9b088ed into OISF:master Feb 28, 2025
60 checks passed
@victorjulien
Copy link
Member

Merged in #12693, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants