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

Keyword elision not implemented with packet access: igmp, pim, igrp, vrrp #138

Merged
merged 2 commits into from
Mar 24, 2015

Conversation

dpino
Copy link
Member

@dpino dpino commented Mar 11, 2015

A filter of "igmp" compiles with pflua, but not a filter of "igmp[8] < 7" or anything else using the [] syntax, unlike tcpdump.

% ./pflua-match ../tests/data/wingolog.pcap "igmp"   
Matched 0/19589 packets in 7934 iterations: ../tests/data/wingolog.pcap (155.411511 MPPS).
% ./pflua-match ../tests/data/wingolog.pcap "igmp[8] < 7"
luajit: ../src/pf/parse.lua:290: 
Error: In expression "igmp[8] < 7"
                           ^
keyword elision not implemented [

stack traceback:
        [C]: in function 'primitive_error'
        ../src/pf/parse.lua:290: in function 'error'
        ../src/pf/parse.lua:838: in function 'parse_primitive_or_arithmetic'
        ../src/pf/parse.lua:859: in function 'parse_logical_or_arithmetic'
        ../src/pf/parse.lua:891: in function 'parse_logical'
        ../src/pf/parse.lua:884: in function 'parse_logical_or_arithmetic'
        ../src/pf/parse.lua:891: in function 'parse_logical'
        ../src/pf/parse.lua:899: in function 'parse'
        ../src/pf.lua:32: in function 'get_predicate'
        ./pflua-match:58: in function 'main'
        ./pflua-match:84: in main chunk
        [C]: at 0x00404bc0
% tcpdump -d "igmp[8] <7" 
(000) ldh      [12]
(001) jeq      #0x800           jt 2    jf 10
(002) ldb      [23]
(003) jeq      #0x2             jt 4    jf 10
(004) ldh      [20]
(005) jset     #0x1fff          jt 10   jf 6
(006) ldxb     4*([14]&0xf)
(007) ldb      [x + 22]
(008) jge      #0x7             jt 10   jf 9
(009) ret      #65535
(010) ret      #0

@kbara kbara changed the title Keyword elision not implemented with packet access: igmp Keyword elision not implemented with packet access: igmp, pim, igrp, vrrp Mar 6, 2015
@kbara
Copy link
Contributor Author

kbara commented Mar 6, 2015

While the above example uses igmp, essentially the same comments hold for pim, igrp, and vrrp.

@kbara kbara mentioned this pull request Mar 9, 2015
@kbara
Copy link
Contributor Author

kbara commented Mar 11, 2015

LGTM. I ran the property-based tester against this patch, specialized to only test packet accesses (on every meaningful protocol), and everything passed.

@dpino dpino force-pushed the packet-access-sctp branch from 27f813b to afc6da1 Compare March 12, 2015 02:52
@dpino
Copy link
Member

dpino commented Mar 12, 2015

I had some concerns about the minimum payload for each protocol so I went through to http://www.networksorcery.com/enp/protocol/sctp.htm and similar to verify the payloads were correct (in some cases they were not).

I also added a parsing test for each protocol.

@kbara Could you ran the property-based tester again? Apparently, the new payloads didn't have any effect in the output code for the examples.

@kbara
Copy link
Contributor Author

kbara commented Mar 23, 2015

LGTM. A manual sanity check looked good, as did tens/hundreds of thousands of random test cases.

% ./pflua-match ../tests/data/wingolog.pcap "igmp[1] < 200" 
Matched 0/19589 packets in 7360 iterations: ../tests/data/wingolog.pcap (144.158173 MPPS).
% ./pflua-match ../tests/data/wingolog.pcap "pim[1] < 200" 
Matched 0/19589 packets in 7576 iterations: ../tests/data/wingolog.pcap (148.405374 MPPS).
% ./pflua-match ../tests/data/wingolog.pcap "igrp[1] < 200" 
Matched 0/19589 packets in 7279 iterations: ../tests/data/wingolog.pcap (142.581487 MPPS).
% ./pflua-match ../tests/data/wingolog.pcap "vrrp[1] < 200" 
Matched 0/19589 packets in 7602 iterations: ../tests/data/wingolog.pcap (148.886247 MPPS).

dpino added a commit that referenced this pull request Mar 24, 2015
Keyword elision not implemented with packet access: igmp, pim, igrp, vrrp
@dpino dpino merged commit 0b40231 into master Mar 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants