Skip to content

fix: accept repeated NetFlow v9 fields - #301

Merged
mikemiles-dev merged 2 commits into
mikemiles-dev:mainfrom
ktsaou:fix/repeated-v9-fields
Jul 20, 2026
Merged

fix: accept repeated NetFlow v9 fields#301
mikemiles-dev merged 2 commits into
mikemiles-dev:mainfrom
ktsaou:fix/repeated-v9-fields

Conversation

@ktsaou

@ktsaou ktsaou commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Problem

Valid NetFlow v9 templates may contain the same field more than once. The parser rejected these templates, so their data records could not be decoded.

This affected:

  • NetFlow v9 data templates
  • NetFlow v9 options templates
  • NetFlow v9 templates carried through the IPFIX parser

Templates are ordered field lists. Repeated fields are valid and their values must remain in that order. This is explicitly required for IPFIX by RFC 7011, section 8.

Fix

  • Accept repeated data, scope, and option fields.
  • Preserve every repeated value in template order.
  • Keep the existing size, field-count, sentinel, and packet-framing limits.
  • Keep the public API unchanged.

Verification

  • Six regression tests cover native NetFlow v9, NetFlow v9 through IPFIX, and persisted templates.
  • Each regression fails before this fix and passes after it.
  • The full project checks pass, including the no-default-features tests.

Release

The crate version is bumped to 1.0.6 and the change is documented in RELEASES.md, as requested.

@mikemiles-dev

Copy link
Copy Markdown
Owner

Interesting, do you know what devices you saw this with?

@mikemiles-dev

Copy link
Copy Markdown
Owner

Also, would you mind bumping the minor version and adding to the RELEASES.md?

@ktsaou

ktsaou commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

I do not have a device-specific capture for this case. I found it during a standards-focused parser audit and reproduced it with minimal synthetic NetFlow v9 packets. RFC 3954 defines templates as ordered field specifiers without a uniqueness restriction, and RFC 7011 section 8 explicitly requires collectors to handle repeated identical Information Elements.

@ktsaou

ktsaou commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

Done in b90ff3b: bumped the crate to 1.0.6 and added the release entry to RELEASES.md. The full project check script and the focused no-default-features tests pass.

@mikemiles-dev

Copy link
Copy Markdown
Owner

Appreciate it, do you need me to publish this sooner than later or can it wait?

@mikemiles-dev
mikemiles-dev merged commit 95cf774 into mikemiles-dev:main Jul 20, 2026
6 checks passed
@ktsaou

ktsaou commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@mikemiles-dev I have a 6 more PRs for your review. These PRs are needed for Netdata's netflow.plugin, so I will wait for you to merge them and release them to continue the integration work with Netdata.

btw, I am using AI for all these. The process involves a swarm of 8 models (gpt-5.6-sol, fable-5, glm-5.2, kimi-k3, minimax-m3, deepseek-v4-pro, mimo-v2.5-pro, qwen3.8-max-preview), which independently need to review and unanomously confirm each defect, compare netflow_parser with all other open-source netflow implementations, find the exact RFC references the code breaks, prove the faults with failing tests and then fix the code surgically (the absolutely minimum required changes to pass the tests).

Some projects reject AI coding agents, so I thought you should know. If you don't like accepting AI code, please let me know.

My audit has revealed more issues which do not affect Netdata. I chose to not open PRs for them. But I can open PRs, or issues, or just ignore them. Your call.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants