-
Notifications
You must be signed in to change notification settings - Fork 857
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
Problem with MPLS capture filter #408
Comments
|
Could you tell if this reproduces with the latest master build of libpcap? |
Problem is reproduced in the latest version of libpcap(git e598f98). Sample file: https://www.cloudshark.org/captures/e3c2e1feee12 $ /opt/tcpdump/sbin/tcpdump --version GOOD ---- $ /opt/tcpdump/sbin/tcpdump -r /Users/sergey/mpls-1-2.pcap -n -nn -v -vv -s 0 "(mpls&&mpls&&icmp)" GOOD -----$ /opt/tcpdump/sbin/tcpdump -r /Users/sergey/mpls-1-2.pcap -n -nn -v -vv -s 0 "(mpls&&icmp)" BAD ---- $ /opt/tcpdump/sbin/tcpdump -r /Users/sergey/mpls-1-2.pcap -n -nn -v -vv -s 0 "(mpls&&mpls&&icmp) or (mpls&&icmp)" P.S. how to upload .pcap file to github issue? |
Thank you. GitHub issues are currently text-only (GitHub-Markdown-only, to be exact), people typically use |
Thanks for explanations. "mpls-1-2.pcap" base64-encoded(for history): 1MOyoQIABAAAAAAAAAAAAAAQAAABAAAAGQnAOH4cAwB2AAAAdgAAAAAwlub8OQAwlgUoOIhHAAHR |
This is, for better or worse, "by-design" or, at least, "not unintended" behavior. To quote the pcap-filter man page:
"Each use of that expression increments the filter offsets by 4." means "once you use it in a filter expression, all filters after it in the filter expression string will check MPLS labels past that label. This means that in
the first two The same applies to Arguably, I don't know whether those changes would affect any filters that depend on the current behavior in a useful fashion; I suspect not, as I can't imagine why |
Hi, I'm hitting the same issue with libpcap 1.5.3. |
Is that a typo on 1.9.3? |
This is a general problem with all of the "Each use of this keyword increments the filter offset by..." keywords, such as A fix would be a bit complicated, because it means that, in |
Actually no, it's not a typo, it's a vendor installed system where they chose to keep it at that version for whatever reason. I think they use their own implementation to analyse traffic, so it probably doesn't matter for them. But for tcpdump & libpcap the problem is still actual and without a solution in sight as I see in Guy's reply, even for newest releases. |
As a workaround I run several jobs to capture using different filters and then merge the saved files: # jobs |
"vlan", "pppoe", "mpls", and some other filter tests work the same way. Duplicate of #798 |
In this case, wouldn't |
And in this case, wouldn't |
It would. This works fine for me when filtering on frames that have either single or double MPLS labels and a specific host:
|
It works fine for me too with "or", like @cjmaynard proposed, so I'm using that instead of the cumbersome two tcpdumps. |
For posterity, there is now a FAQ entry about this. |
Duplicate of #798 |
tcpdump -i eth4 "(mpls && mpls && port 161) or (mpls && port 161)" -w all_snmp.pcap - captures traffic only with 2 mpls labels. there is no traffic with 1 mpls label in "all_snmp.pcap"
The text was updated successfully, but these errors were encountered: