-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fix 'proto' operation #257
Conversation
@@ -1236,6 +1236,10 @@ function selftest () | |||
expand(parse("ether[0] = 2"), 'EN10MB')) | |||
assert_equals(expand(parse("src 1::ff11"), 'EN10MB'), | |||
expand(parse("src host 1::ff11"), 'EN10MB')) | |||
assert_equals(expand(parse("proto sctp"), 'EN10MB'), | |||
expand(parse("ip proto sctp or ip6 proto sctp"), 'EN10MB')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly wrong, if we're going for libpcap language compatibility.
% sudo tcpdump -d -ni wlan0 'ip proto tcp'
tcpdump: syntax error
% sudo tcpdump -d -ni wlan0 'ip proto \tcp'
(000) ldh [12]
(001) jeq #0x800 jt 2 jf 5
(002) ldb [23]
(003) jeq #0x6 jt 4 jf 5
(004) ret #262144
(005) ret #0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(See man pcap-filter
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks, I should've put backslashes on those in the test. (pflua already seems to accept either backslash or none to begin with on these)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks!
It looks like at some point the
proto
operation broke in pflua. I've added some tests for it and added a fix.This also updates the
proto \sctp
example. I was less sure about this part so please let me know if I didn't do the update quite right.Related to issue #255