-
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: handle TCP flags #391
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
ccae28f
Update ebpf-agent dependency
ronensc 0c72d5c
Fix Generic related build issues
ronensc 0f1a439
Add Flags fields to decode_protobuf
ronensc 00311a8
Rename test funcions
ronensc 457f32b
Handle FIN_ACK
ronensc 55f5835
Add a test for MoveToFront
ronensc 797908e
Validate TCPFlags field name is not empty
ronensc 1db84db
Add correct direction
ronensc 0be8d9f
Add test case for mismatch of AB field count
ronensc 8dce385
Add operational metric for tcp flags
ronensc 1c5242b
Rename CorrectDirection -> SwapAB
ronensc 2ebbe10
Change test
ronensc 55d5599
Update README
ronensc a636ea7
Add json tag to conntrack api
ronensc e861beb
Update docs
ronensc a7c41c4
Rename variable
ronensc af8ec46
Make linter happy
ronensc 6c0470e
Make linter happy
ronensc 5b5748e
Enable SwapAB only when the feature flag is set
ronensc 60245a3
Fix rebase errors
ronensc 89a3971
NETOBSERV-838 fix IsDuplicate
jpinsonneau 833136a
Add missing 'omitempty'
ronensc 72847f7
Add parenthesis for clarity
ronensc 3b48145
Add tests for IsDuplicate()
ronensc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,8 @@ import "github.com/netobserv/flowlogs-pipeline/pkg/utils" | |
|
||
type GenericMap map[string]interface{} | ||
|
||
const duplicateFieldName = "Duplicate" | ||
|
||
// Copy will create a flat copy of GenericMap | ||
func (m GenericMap) Copy() GenericMap { | ||
result := make(GenericMap, len(m)) | ||
|
@@ -33,8 +35,8 @@ func (m GenericMap) Copy() GenericMap { | |
} | ||
|
||
func (m GenericMap) IsDuplicate() bool { | ||
if duplicate, hasKey := m["Duplicate"]; hasKey { | ||
if isDuplicate, err := utils.ConvertToBool(duplicate); err != nil { | ||
if duplicate, hasKey := m[duplicateFieldName]; hasKey { | ||
if isDuplicate, err := utils.ConvertToBool(duplicate); err == nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While testing this PR I noticed I've made a mistake here 👼 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the fix! I missed that too... |
||
return isDuplicate | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I wonder if these two should be the default behavior as it's more reliable & convenient than the timeouts
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.
The
swapAB
feature isn't related to the timeouts.The
detectEndConnection
feature is in addition to the timeouts. It can't replace the timeouts because it's not guaranteed that will receive a flowlog withFIN_ACK
flag for every TCP connection (either because of sampling or because of SYN attack). But, it may allow us to increase theendConnectionTimeout
for TCP.