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

fix(inputs.netflow): Decode flags in TCP and IP headers correctly #16248

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

joseluisgonzalezca
Copy link
Contributor

@joseluisgonzalezca joseluisgonzalezca commented Nov 29, 2024

Summary

This problem is present during IPv4 header decoding and TCP header decoding. Both issues have been fixed in this PR.
Golang switch block does not do automatic fallthrough so it must be explicitly added to handle multiple cases

Checklist

  • No AI generated code was used in this PR

Related issues

resolves issue #16247

…aders

Golang switch block does not do automatic fallthrough so it must be explicitly added to handle multiple cases
@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Nov 29, 2024
…itch statements to if statements

fallthrough usage is not valid because next condition is not evaluated
@joseluisgonzalezca
Copy link
Contributor Author

I have tested the PR build artefact in a real environment and it's working as expected. All flags are decoded and included into the metrics:
image

@srebhan srebhan changed the title fix(inputs.netflow): handle decode of multiple flags in TCP and IP he… fix(inputs.netflow): Decode flags in TCP and IP headers correctly Dec 2, 2024
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Thanks a lot for spotting this @joseluisgonzalezca! The contribution is much appreciated!

Could you please also check the other decoders!?!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 2, 2024
@DStrand1 DStrand1 merged commit 9cff0ce into influxdata:master Dec 3, 2024
31 checks passed
@github-actions github-actions bot added this to the v1.33.0 milestone Dec 3, 2024
@joseluisgonzalezca
Copy link
Contributor Author

Thanks a lot for spotting this @joseluisgonzalezca! The contribution is much appreciated!

Could you please also check the other decoders!?!

Hi Sven,

I've reviewed the sFlow decoder source code and I haven't detected any additional issues. Nevertheless, we are actively using the plugin and checking received metrics. As soon as I found any anomaly, I will report it and try to solve it.

Thanks!

justinwwhuang pushed a commit to justinwwhuang/telegraf_fork that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants