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

Automated cherry pick of #6821: Fix packetcapture bpf filter issue (#6815) (#6821) #6827

Open
wants to merge 1 commit into
base: release-2.2
Choose a base branch
from

Conversation

hangyan
Copy link
Member

@hangyan hangyan commented Nov 21, 2024

Cherry pick of #6821 on release-2.2.

#6821: Fix packetcapture bpf filter issue (#6815) (#6821)

For details on the cherry pick process, see the cherry pick requests page.

In PacketCapture, packets which don’t match the target BPF can be
received after the socket is created and before the bpf filter is
applied. This patch uses a zero bpf filter (matches no packet), then
empties out any packets that arrived before the "zero-BPF" filter was
applied. At this point the socket is definitely empty and it can’t
fill up with junk because the zero-BPF is in place. Then we replace
the zero-BPF with the real BPF we want.

Signed-off-by: Hang Yan <[email protected]>
Co-authored-by: Antonin Bas <[email protected]>
@hangyan hangyan added the kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release label Nov 21, 2024
@hangyan
Copy link
Member Author

hangyan commented Nov 21, 2024

will also cherry-pick #6804 once this get merged, as i can remember these two has conflicts.

@luolanzone
Copy link
Contributor

@hangyan you can cherry-pick two bug fixes in one PR if they are related changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cherry-pick Categorizes issue or PR as related to the cherry-pick of a bug fix from the main branch to a release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants