Skip to content

Outermost VLAN tag is dropped when capture a packet with multiple VLAN tags #838

@Weihj99

Description

@Weihj99

Describe the bug
When capturing a packet with multiple VLAN tags, the outermost VLAN tag is dropped.

To Reproduce
Steps to reproduce the behavior:

  1. Run Wireshark and start packet capture on the target network interface
  2. Run the following Python code:
from scapy.all import Ether, Dot1Q, IP, ICMP, Raw, sendp


def send_vlan_icmp(
    iface: str,
    dst_mac: str,
    src_mac: str,
    vlan_id: int,
    src_ip: str,
    dst_ip: str,
) -> None:
    pkt = (
        Ether(src=src_mac, dst=dst_mac)
        / Dot1Q(vlan=vlan_id)
        / Dot1Q(vlan=vlan_id + 1)
        / IP(src=src_ip, dst=dst_ip)
        / ICMP()
        / Raw(load=b"multiple VLAN headers test")
    )
    
    sendp(pkt, iface=iface, verbose=False)
    return pkt


if __name__ == "__main__":
    pkt = send_vlan_icmp(
        # iface="VMware Network Adapter VMnet8",
        # use YOUR OWN network 
        iface="Ethernet 3",
        dst_mac="ff:ff:ff:ff:ff:ff",
        src_mac="00:11:22:33:44:55",
        vlan_id=4,
        src_ip="192.168.10.2",
        dst_ip="192.168.10.1",
    )
  1. Check the captured packet in wireshark; you will notice the captured packet has only one VLAN tag (VLAN ID 5), and the outer VLAN tag is missing.
  2. If the target network is connected to a port of a Vector VN5640, monitoring the received packets on the VN5640 confirms that the outer VLAN tag is actually present.

Expected behavior
all vlan tags are expected to be captured

Screenshots
packet captured by wireshark
Image
packet captured by canoe

Image

Diagnostic information

  • Windows 11 Version 21H2, OS Build 22000.258
  • tested on Intel(R) Ethernet Connection (16) I219-V, ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter, Realtek(R) USB GbE Family Controller, VMware Virtual Network Adapter

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions