Skip to content

Null/loopback header is incorrectly interpreted as Ethernet2Header #78

@GyulyVGC

Description

@GyulyVGC

Hi @JulianSchmid, as you may know I'm using etherparse in Sniffnet.

Some users complained about the impossibility to see traffic when monitoring their VPN TUN interfaces, and today I tried it myself and found out that the problem resides in the fact that etherparse doesn't correctly identify the traffic as null/loopback, but it still identifies it as ethernet.

This is how a sample packet looks like in Wireshark:
Screenshot 2023-12-22 at 12 18 21

As you can see, it's tagged as Null/loopback.

However, etherparse still categorise this as ethernet. The consequences are multiple:

  • source and destination MAC addresses are assigned to the first bytes of the packet even if it's not actually an ethernet header
  • IP and transport header are not detected even if they are present

In particular I double checked and found out that etherparse says that ip and transport header are None, and as you can see from the screenshot below MAC addresses are assigned to the first bytes of the packet, even if those bytes are not supposed to be MAC address but part of the Null/loopback header and part of the IP header.

Screenshot 2023-12-22 at 12 22 53

I think the solution would just require to correctly parse the loopback header and changing the offset to automatically parse the following ip and transport headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions