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

event: correctly parse TCP DESTROY events on kernels 5.11 and later #31

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

ti-mo
Copy link
Owner

@ti-mo ti-mo commented Dec 21, 2022

Linux commit 86d21fc74745 ("netfilter: ctnetlink: add timeout and protoinfo to
destroy events") added protoinfo to destroy events, but in doing so, changed
the logic used to assemble the ProtoInfoTCP payload, causing TCP flags to not be
sent as attributes.

This invalidated a long-standing assumption in the library that ProtoInfoTCP
would always contain at least 3 attributes. This commit relaxes the parser and
fixes the error returns of the SCTP and DCCP families.

TestConnListen now ranges over TCP, UDP, SCTP and DCCP families to verify if all
of NEW/UPDATE/DESTROY events can be parsed for all families.
@coveralls
Copy link

coveralls commented Dec 21, 2022

Pull Request Test Coverage Report for Build 3752934169

  • 26 of 30 (86.67%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 91.593%

Changes Missing Coverage Covered Lines Changed/Added Lines %
event.go 16 20 80.0%
Totals Coverage Status
Change from base Build 3739761821: -0.3%
Covered Lines: 1340
Relevant Lines: 1463

💛 - Coveralls

@ti-mo ti-mo merged commit 7b6dc48 into master Dec 21, 2022
@ti-mo ti-mo deleted the unmarshal-protoinfotcp-event branch December 21, 2022 21:29
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.

Error "ProtoInfoTCP unmarshal: need (at least) 2 child attributes" on Ubuntu 22.04
2 participants