-
Notifications
You must be signed in to change notification settings - Fork 24
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
conntrack: Fix a bug in swapAB #415
Conversation
Swap hashA and hashB when swapAB is flagged
Codecov Report
@@ Coverage Diff @@
## main #415 +/- ##
==========================================
- Coverage 64.39% 64.37% -0.02%
==========================================
Files 94 94
Lines 6560 6563 +3
==========================================
+ Hits 4224 4225 +1
- Misses 2096 2097 +1
- Partials 240 241 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @ronensc ! Code LGTM
Would this bug result in duplicated connections coming from the same FLP ? I don't think I've seen such
I don't think this bug would result in duplicated connections |
@ronensc @jotak we should backport this in release-1.2 |
+1 to backport. |
New image: quay.io/netobserv/flowlogs-pipeline:d6f2770. It will expire after two weeks. |
Yeah, I am fine too. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jotak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
When implementing the swapAB logic I missed the fact that in addition to swapping the values of the connection source and destination, their hashes should be swapped as well. Without this, aggregates such as
Bytes_AB
andBytes_BA
would be wrong.I realized that I had the same bug in the unit test the was supposed to test it.
This PR fixes the problem and the test.
Once merged, this will allow us to spot connections that their source and destination were swapped by inspecting their
newConnection
record. TheBytes_AB
would be 0 whileBytes_BA
would be >0.