-
Notifications
You must be signed in to change notification settings - Fork 913
DSA is not Ethernet #1587
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
DSA is not Ethernet #1587
Conversation
7208562 to
4e7eff0
Compare
|
In my working copy |
The packet direction from In kernel-mode filtering, that has to be done by testing the special packet offset, as it's not part of the skbuff data. It's also supported in user-mode filter when capturing on Linux, as That information is put into the packet data only in cooked mode, so it doesn't appear in non- Full support of pcapng would allow saving metadata in the capture file, and thus would allow Whether direction information in the DSA headers agrees with direction information from the Linux networking stack is another matter. |
|
Let me debug this a bit more to understand what exactly works and what does not. |
|
Having considered these comments for a while, I understand these reasons also explain #1482. In this case on Linux for the specific case of DSA the kernel's idea of the frame direction will never be available in userspace because the capture must not use cooked mode to preserve the headers. Ironically, it is possible to tell the kernel to filter the frames based on its idea of the direction, but it is impossible to know directly what it is. On the one hand, this means there would be no immediate gain in introducing another DLT, something such as On the other hand, there may be a good reason to define the Linux unknown DSA DLT with other useful metadata, such as the interface name (or index) and the DSA tag name (or number from Given no other input, I am going to change this into a generic non-DSA non-Linux DLT and to merge these changes soon to enable back-porting to libpcap-1.10. This looks very similar to the problem that |
...
The |
In dsa_protos[] remove the "none" non-DSA case to make the array purely DSA and switch all DLT_EN10MB DSA tags types to DLT_DEBUG_ONLY; update the comments to make it clear that using DLT_EN10MB would not work, give better directions for what to do instead, do not say for every DSA tag whether a DLT is/isn't and should/shouldn't be assigned because that is now supposed to be obvious, do not suggest DLT_LINUX_SLL (this would add the packet direction at the cost of losing other headers). In iface_dsa_get_proto_info() handle the "none" non-DSA case first; for a DSA case default to DLT_DEBUG_ONLY, always return 1, make sure the DLT is never DLT_EN10MB and add a comment to explain the rationale. See also GH the-tcpdump-group#1367 and the-tcpdump-group#1451.
4e7eff0 to
976d885
Compare
|
Thank you for explaining that, but I can neither prove this theory wrong nor implement it in code safely in a timely manner. This revision introduces and uses a very generic |
As per Vladimir Oltean comments in GH the-tcpdump-group#1451.
No description provided.