From 01f11e9705e2adcea0423eb53dbca04952caf224 Mon Sep 17 00:00:00 2001 From: Max Rottenkolber Date: Mon, 25 Nov 2019 18:18:28 +0100 Subject: [PATCH] pflua: do not cdef struct bpf_ins (collides with ljsyscall) --- lib/pflua/src/pf/types.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/pflua/src/pf/types.lua b/lib/pflua/src/pf/types.lua index 4ad1758864..5a727b14f8 100644 --- a/lib/pflua/src/pf/types.lua +++ b/lib/pflua/src/pf/types.lua @@ -38,10 +38,6 @@ struct pcap_pkthdr { -- with the high-bit set as negative int32_t values, so we do the same -- for all of our 32-bit values including the "k" field in BPF -- instructions. -ffi.cdef[[ -struct bpf_insn { uint16_t code; uint8_t jt, jf; int32_t k; }; -struct bpf_program { uint32_t bf_len; struct bpf_insn *bf_insns; }; -]] local bpf_program_mt = { __len = function (program) return program.bf_len end, __index = function (program, idx) @@ -50,8 +46,8 @@ local bpf_program_mt = { end } -bpf_insn = ffi.typeof("struct bpf_insn") -bpf_program = ffi.metatype("struct bpf_program", bpf_program_mt) +bpf_insn = ffi.typeof("struct { uint16_t code; uint8_t jt, jf; int32_t k; }") +bpf_program = ffi.metatype("struct { uint32_t bf_len; struct bpf_insn *bf_insns; }", bpf_program_mt) pcap_record = ffi.typeof("struct pcap_record") pcap_pkthdr = ffi.typeof("struct pcap_pkthdr")