-
Notifications
You must be signed in to change notification settings - Fork 904
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
Conversation
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>
No actions on this PR?
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
Any objections to merge this?
This will need a change log entry. A few filter tests would be useful too.
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?
I really don't know, sorry.
Alright, let's think about it.
Uh oh!
There was an error while loading. Please reload this page.
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,