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
Filter on IP field does not work when MPLS is present. #1070
Comments
Hi Denis, And thanks for the reply. I am not sure I understood it properly even after reading those other issues and mpls option. If I understood properly, every time you use the keyword So I still have the following questions?
Thanks a lot! Edit: Could it be that to do what i want I have to do :
This will either do normal IP packets, or 1 label, 2, 3, 4, 5, 6, etc...? Isnt there a way to do this simpler? |
If you want to understand the filters, the pcap-filter man page would be the first reference material (that said, if you spot a valid place for improvement there, please contribute it).
This might make more sense if you consider that pcap filters work in libpcap, often in the OS kernel, and the packet decoding you see works in tcpdump, in a mostly independent manner. That is, what tcpdump knows about MPLS label stack and the data before and after it does not depend on what libpcap knows about MPLS label stack and the data before and after it. |
This issue seems to be addressed. Would anybody like to add anything before closing? |
For posterity, there is now a FAQ entry about this. |
Version:
tcpdump version 4.9.3
libpcap version 1.8.1
OpenSSL 1.1.1 11 Sep 2018
I have experienced some weird behaviour when trying to match to
IP tos
field, when MPLS is present. To show you what happens, I am simply pinging between two nodes, the ping goes encapsulated over mpls, while the reply has no mpls. For all the experiments I am sending one single ping (request and reply).So far, so good. And as you can see, for both packets it parses the
IP tos
field. However, I want to only capture packets with some specific tos field, thus I use the filterip[1]==tos
. However, when doing so,mpls
packets are not displayed, only the IP ping reply.Ok, I thought I need to extend the filter to have mpls && ip[1]==0 or ip[1]==0. So if i try that... for some reason I am only getting the
mpls
packet, why?However, if I if keep the same filter, but I reverse the logical expression it does work, like why?? I am missing something, is this a bug? See below:
Is there any difference between the last two expressions? I could not find anything in the documentation.
Thanks!
The text was updated successfully, but these errors were encountered: