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

Warnint util 4516 v8.1 #7120

Closed
wants to merge 3 commits into from

Conversation

catenacyber
Copy link
Contributor

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

Describe changes:

  • Fix integer warnings -Wimplicit-int-conversion for output, flow, and app-layer files

Part of #7006 as #7107 was

Changed from #7006 to keep using FlowState in function prototype and using an explicit cast afterwards to get rid of warning about implicit integer conversion

@catenacyber catenacyber requested a review from a team as a code owner March 6, 2022 13:26
@catenacyber catenacyber mentioned this pull request Mar 6, 2022
@codecov
Copy link

codecov bot commented Mar 6, 2022

Codecov Report

Merging #7120 (e00a7d0) into master (3a490fb) will decrease coverage by 0.00%.
The diff coverage is 82.43%.

@@            Coverage Diff             @@
##           master    #7120      +/-   ##
==========================================
- Coverage   78.06%   78.06%   -0.01%     
==========================================
  Files         628      628              
  Lines      185266   185236      -30     
==========================================
- Hits       144635   144602      -33     
- Misses      40631    40634       +3     
Flag Coverage Δ
fuzzcorpus 60.00% <27.02%> (+0.01%) ⬆️
suricata-verify 54.56% <95.31%> (-0.04%) ⬇️
unittests 63.13% <18.75%> (+<0.01%) ⬆️

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

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 6529

@victorjulien victorjulien self-assigned this Apr 1, 2022
@@ -580,8 +580,7 @@ void FlowInitConfig(bool quiet)
FatalError(SC_ERR_FATAL, "Invalid value for flow.hash-size: NULL");
}

if (StringParseUint32(&configval, 10, strlen(conf_val),
conf_val) > 0) {
if (StringParseUint32(&configval, 10, (uint16_t)strlen(conf_val), conf_val) > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

while I'm generally not a fan of size_t, I wonder if we should use it here as we'd most of the time pass the result of strlen()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in #7239

Copy link
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

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

Comment inline

@catenacyber
Copy link
Contributor Author

Replaced by #7219

@catenacyber catenacyber closed this Apr 8, 2022
victorjulien added a commit to victorjulien/suricata that referenced this pull request Jun 24, 2024
Implement new `type backoff` for thresholding. This allows alerts to be
limited.

A count of 1 with a multiplier of 10 would generate alerts for matching packets:
1, 10, 100, 1000, 10000, 100000, etc.

A count of 1 with a multiplier of 2would generate alerts for matching packets:
1, 2, 4, 8, 16, 32, etc.

Like with other thresholds, rule actions like drop and setting of
flowbits will still be performed for each matching packet.

Current implementation is only for the by_flow tracker and for per rule
threshold statements.

Ticket: OISF#7120.
victorjulien added a commit to victorjulien/suricata that referenced this pull request Jun 28, 2024
Implement new `type backoff` for thresholding. This allows alerts to be
limited.

A count of 1 with a multiplier of 10 would generate alerts for matching packets:
1, 10, 100, 1000, 10000, 100000, etc.

A count of 1 with a multiplier of 2 would generate alerts for matching packets:
1, 2, 4, 8, 16, 32, etc.

Like with other thresholds, rule actions like drop and setting of
flowbits will still be performed for each matching packet.

Current implementation is only for the by_flow tracker and for per rule
threshold statements.

Tracking is done using uint32_t. When it reaches this value, the rest of
the packets in the tracker will use the silent match.

Ticket: OISF#7120.
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