Skip to content

Conversation

liheng562653799
Copy link

@liheng562653799 liheng562653799 commented Oct 16, 2025

Fix the snmp app-layer config problem, Normalize the dynamic alproto registration

bug: #8000

Make sure these boxes are checked accordingly before submitting your Pull Request -- thank you.

Contribution style:

Our Contribution agreements:

Changes (if applicable):

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

Describe changes:

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

  • To use a 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=

Fix the snmp app-layer config problem, Normalize the dynamic alproto registration

bug: OISF#8000
Copy link
Contributor

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Thanks for this work.

My main remark is :
Could we have a suricata-verify test for this ?

Also, CI is red because of nits like formatting... Could you fix it ?

For the commit title, I would phrase more like the solution than the problem, something like
snmp: can be set to detection-only

dir: SCOutputJsonLogDirection::LOG_DIR_PACKET as u8,
LogTx: Some(snmp_log_json_response),
};
SCOutputEvePreRegisterLogger(reg_data);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it mean that we should call SCOutputEvePreRegisterLogger even if SCAppLayerProtoDetectConfProtoDetectionEnabled returns 0 ?

I would not think so

{
SCEnter();

if (alp_ctx.ctxs_len <= alproto && alproto < g_alproto_max) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure about the moving of this code to be called in AppProtoRegisterProtoString

Could you explain it in the commit message ?

Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 93.02326% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.44%. Comparing base (93c0409) to head (7f6e248).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14045   +/-   ##
=======================================
  Coverage   84.43%   84.44%           
=======================================
  Files        1011     1011           
  Lines      272251   272261   +10     
=======================================
+ Hits       229876   229909   +33     
+ Misses      42375    42352   -23     
Flag Coverage Δ
fuzzcorpus 63.41% <88.37%> (+<0.01%) ⬆️
livemode 19.34% <88.37%> (-0.01%) ⬇️
pcap 44.83% <88.37%> (+0.01%) ⬆️
suricata-verify 65.19% <93.02%> (+<0.01%) ⬆️
unittests 59.45% <88.37%> (-0.01%) ⬇️

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants