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

Support old conntrack stats #500

Merged
merged 1 commit into from
Mar 21, 2023
Merged

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented Mar 15, 2023

Linux < 2.6.35 was missing the search_restart field in nf_conntrack.

  • Refactor stat parsing to simplify code.
  • Support 16-field nf_conntrack entries.
  • Support additional fields.

Fixes: #499

Linux < 2.6.35 was missing the `search_restart` field in nf_conntrack.
* Refactor stat parsing to simplify code.
* Support 16-field nf_conntrack entries.
* Support additional fields.

Fixes: #499

Signed-off-by: SuperQ <superq@gmail.com>
@SuperQ SuperQ force-pushed the superq/conntrack_old_kernel branch from bc5ff9c to d193bd7 Compare March 15, 2023 08:25
Copy link
Collaborator

@pgier pgier left a comment

Choose a reason for hiding this comment

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

LGTM, just left one question inline.

@@ -64,6 +64,21 @@ func ParsePInt64s(ss []string) ([]*int64, error) {
return us, nil
}

// Parses a uint64 from given hex in string.
func ParseHexUint64s(ss []string) ([]*uint64, error) {
us := make([]*uint64, 0, len(ss))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this return a uint64 slice instead of *uint64?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could, I was following the pattern of the other string parsers here.

@discordianfish discordianfish merged commit dd6bb71 into master Mar 21, 2023
@discordianfish discordianfish deleted the superq/conntrack_old_kernel branch March 21, 2023 17:36
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.

Failed to retrieve conntrack stats on an armv5 based Synology NAS
3 participants