Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable filter functionality for DLT_DSA_TAG_DSA and DLT_DSA_TAG_EDSA. #1195

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

Open
Hexxel wants to merge 1 commit into the-tcpdump-group:master
base: master
Choose a base branch
Loading
from Hexxel:edsa_filter

Conversation

Copy link

@Hexxel Hexxel commented Jun 1, 2023
edited
Loading

We want to use tcpdump filter functionality on a DSA/EDSA link layer device, but there doesn't seem to be supported right now. I'm not well versed in the libpcap implementation so I naively looked at the existing code and did the following changes in this PR. Please don't hit me over the head :/
Is this the right way of doing it or do you have any suggestions where I should look for a better solution/approach?

Best regards,

To be able to use filters on link layer DSA/EDSA, allow
those link types to generate code.
Signed-off-by: Mattias Forsblad <mattias.forsblad@gmail.com>
@Hexxel Hexxel changed the title (削除) RFC: DSA/EDSA: Enable filter functionality (削除ここまで) (追記) DSA/EDSA: Enable filter functionality (追記ここまで) Jun 16, 2023
@Hexxel Hexxel marked this pull request as ready for review June 16, 2023 10:03
Copy link
Author

Hexxel commented Apr 17, 2024

No actions on this PR?

Copy link
Member

FWIW, I do not see any immediate problems with the proposed change.

Before:

$ ./tcpdump -n -r tests/dsa.pcap -ve icmp
reading from file tests/dsa.pcap, link-type DSA_TAG_DSA (Marvell DSA), snapshot length 262144
tcpdump: Marvell DSA link-layer type filtering not implemented

After:

$ ./tcpdump -n -r tests/dsa.pcap -ve -c 1 'icmp[icmptype] = icmp-echo'
reading from file tests/dsa.pcap, link-type DSA_TAG_DSA (Marvell DSA), snapshot length 262144
23:21:39.544060 00:50:b6:29:10:70 > d6:c5:28:21:3e:af, Marvell DSA mode Forward, dev 0, port 1, untagged, VID 0, FPri 0, ethertype IPv4 (0x0800), length 102: (tos 0x0, ttl 64, id 14057, offset 0, flags [DF], proto ICMP (1), length 84)
 192.168.30.1 > 192.168.30.2: ICMP echo request, id 13586, seq 1, length 64
$ ./tcpdump -n -r tests/edsa.pcap -ve -c 1 'arp'
reading from file tests/edsa.pcap, link-type DSA_TAG_EDSA (Marvell EDSA), snapshot length 262144
23:21:49.680084 c6:e8:9f:7d:69:da > 00:50:b6:29:10:7e, Marvell EDSA ethertype 0xdada (Unknown), rsvd 0 0, mode From CPU, target dev 0, port 0, untagged, VID 0, FPri 0, ethertype ARP (0x0806), length 50: Ethernet (len 6), IPv4 (len 4), Request who-has 192.168.20.1 tell 192.168.20.2, length 28
Hexxel reacted with thumbs up emoji

Copy link
Member

Any objections to merge this?

Copy link
Member

This will need a change log entry. A few filter tests would be useful too.

Copy link
Member

If these changes are applied and off_nl_nosnap is set to OFFSET_NOT_SET and the DLT contains an Ethernet packet (with a commensurate switch tag) that is a 802.2 LLC packet, will everything work as usual?

Copy link
Author

Hexxel commented Jan 9, 2025

I really don't know, sorry.

Copy link
Member

Alright, let's think about it.

@infrastation infrastation changed the title (削除) DSA/EDSA: Enable filter functionality (削除ここまで) (追記) Enable filter functionality for DLT_DSA_TAG_DSA and DLT_DSA_TAG_EDSA. (追記ここまで) Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /