-
Notifications
You must be signed in to change notification settings - Fork 63
Description
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:

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.
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.
