pflua icon indicating copy to clipboard operation
pflua copied to clipboard

Pflua should maybe emit a parse error for "proto tcp"

Open takikawa opened this issue 8 years ago • 1 comments

On this expression, tcpdump emits a syntax error:

/usr/sbin/tcpdump -d "proto tcp"
tcpdump: syntax error

While Pflua has an internal error:

$ ../tools/pflua-compile "proto tcp"
luajit: ./pf/expand.lua:1149: attempt to index local 'op' (a nil value)
stack traceback:
    ./pf/expand.lua:1149: in function 'expand_arith'
    ./pf/expand.lua:1169: in function 'expand_relop'
    ./pf/expand.lua:1187: in function 'expand_bool'
    ./pf/expand.lua:1182: in function 'expand_bool'
    ./pf/expand.lua:1214: in function 'expand'
    ./pf.lua:37: in function 'compile_filter'
    ../tools/pflua-compile:58: in main chunk
    [C]: at 0x004046e0

takikawa avatar Sep 16 '16 18:09 takikawa

Agreed, that would be better.

kbara avatar Sep 19 '16 08:09 kbara