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

[bugfix] Fix incorrect handling of mock ring buffer wrap around #25

Merged

Conversation

fako1024
Copy link
Owner

@fako1024 fako1024 commented May 1, 2023

@els0r FYI, this should fix the issues mentioned here. Luckily it turned out not to be a fundamental race condition, just incorrect handling (and missing tests) for the mock ring buffer wrap-around. The memory barrier in place via the TPacket status field seems to mimic the "real" kernel buffer sufficiently without additional synchronization.

Closes #24

@fako1024 fako1024 added the bug Something isn't working label May 1, 2023
@fako1024 fako1024 added this to the Initial Release (v1) milestone May 1, 2023
@fako1024 fako1024 requested a review from els0r May 1, 2023 14:14
@fako1024 fako1024 self-assigned this May 1, 2023
@fako1024 fako1024 linked an issue May 1, 2023 that may be closed by this pull request
Copy link
Collaborator

@els0r els0r left a comment

Choose a reason for hiding this comment

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

As far as I can judge: LGTM

capture/afpacket/afring/afring.go Show resolved Hide resolved
capture/afpacket/afring/afring_mock.go Outdated Show resolved Hide resolved
@fako1024 fako1024 merged commit 9ff071e into main May 4, 2023
@fako1024 fako1024 deleted the 24-incorrect-handling-of-mock-ring-buffer-wrap-around branch May 4, 2023 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect handling of mock ring buffer wrap-around
2 participants