pflua
pflua copied to clipboard
bpf-lua pipeline: division by a constant wrongly fails
% ./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.
This bug is specific to the non-optimized bpf-lua pipeline; with --force-opt, the problem does not show up.