-
Notifications
You must be signed in to change notification settings - Fork 855
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
disabling NETIF_F_HW_VLAN_CTAG_TX issue #1317
Comments
In Ethernet traffic, having 0x08 0x06 in octets 12 and 13 of a frame is normal for non-VLAN ARP frames; having them in octets 16 and 17 is normal for VLAN ARP frames. If you want to filter out non-VLAN ARP frames, the filter is If you want to filter out only VLAN ARP frames, the filter is 'not (vlan and arp)`. That will not filter out non-ARP VLAN frames. When capturing on a Linux Ethernet adapter, the generated code is:
That's a bit weird, as it has to handle frames that have VLAN tags stripped out and frames that don't have VLAN tags stripped out. If you want to filter out VLAN ARP frames as well as non-VLAN ARP frames, the filter would, in theory, be
That's a bug, but it's not the cause of the problem you're seeing. |
So it's a kernel issue? can it be solved on libpcap? |
The filter The filter Neither of those are kernel issues. The kernel issue is that, before handing packets to the That kernel issue is already handled in libpcap. |
When disabling NETIF_F_HW_VLAN_CTAG_TX feature, the tcpdump can't filter arp type correctly.
please run the following command to repro.
everything runs on the same board(include ping and tcpdump).
1.create VLAN
sudo ip link del link eno1 name eno1.50 type vlan id 50
sudo ip link add link eno1 name eno1.50 type vlan id 50
sudo ip link set eno1.50 type vlan egress 0:5 1:5 2:5 3:5 4:5 5:5 6:5 8:5
sudo ifconfig eno1.50 182.31.50.1 netmask 255.255.254.0 up
2.disbale NETIF_F_HW_VLAN_CTAG_TX feature
ethtool -K eno1 txvlan off
3.ping
ping 182.31.50.99 -I eno1.50 > /dev/null &
4.tcpdump
tcpdump -i eno1 arp
Normally, the 12th-13th data is equal 0x806(arp type), but actually result above is at 16th-17th(check from tpacket_rcv()).
Or The result is correct through modifying BPF code.
the date printed on tpacket_rcv() are the same as below.
The text was updated successfully, but these errors were encountered: