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

Add support for filtering VNTag frames #1479

Closed

Conversation

stefan-baranoff
Copy link

Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag.

Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional vlan [vlan_id] after the vntag keyword to easily filter on the VLAN ID following the VNTag.

Fixes #770

Add a "vntag" keyword similar to the existing "vlan" and "mpls" keywords to filter on VNTag frames. VNTag was proposed as 802.1Qbh but has been replaced in the standards by 802.1Qbr although some vendors are still using VNTag.

Because VNTag is always followed by VLAN and the following VLAN has the next EtherType, both the VNTag and VLAN have to be present to match and both have to be skipped in processing. So, this commit also adds an optional `vlan [vlan_id]` after the `vntag` keyword to easily filter on the VLAN ID following the VNTag.

Fixes the-tcpdump-group#770
@infrastation
Copy link
Member

Please cover the new code with tests as much as you can (see "accept", "apply" and "reject" tests types in TESTrun) and add a test packet capture with the encodings that exercise the new code paths.

@stefan-baranoff
Copy link
Author

Understood -- I opened the PR a little pre-maturely anyway; my branch name was off (nvtag vs vntag) and I realized I didn't have tests so closed right as you were leaving the comment. I'll re-open a new PR with tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

vn-tag support required for bpf
2 participants