pflua icon indicating copy to clipboard operation
pflua copied to clipboard

bpf-lua pipeline: division by a constant wrongly fails

Open kbara opened this issue 9 years ago • 1 comments

% ./pflua-pipelines-match ../tests/data/wingolog.pcap "10 / 5 > 0" 1
luajit: ../src/pf/bpf.lua:256: division by non-constant value is unsupported
stack traceback:
    [C]: in function 'assert'
    ../src/pf/bpf.lua:256: in function 'alu'
    ../src/pf/bpf.lua:327: in function 'compile_lua'
    ../src/pf/bpf.lua:444: in function 'compile_filter'
    ./pflua-pipelines-match:68: in function 'create_preds'
    ./pflua-pipelines-match:85: in function 'main_pflang'
    ./pflua-pipelines-match:168: in function 'run_filters'
    ./pflua-pipelines-match:172: in main chunk
    [C]: at 0x00404bc0

Needless to say, 5 is a constant, and this error should not be occurring.

kbara avatar May 12 '15 13:05 kbara

This bug is specific to the non-optimized bpf-lua pipeline; with --force-opt, the problem does not show up.

kbara avatar May 12 '15 14:05 kbara