Skip to content
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

Merged
merged 3 commits into from
Dec 2, 2016
Merged

Fix 'proto' operation #257

merged 3 commits into from
Dec 2, 2016

Conversation

takikawa
Copy link
Member

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

@@ -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'))
Copy link
Contributor

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

Copy link
Contributor

@kbara kbara Sep 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(See man pcap-filter)

Copy link
Member Author

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)

Copy link
Contributor

@wingo wingo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@takikawa takikawa merged commit 5888d8d into Igalia:master Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants