+ prog->insns_cnt = size / sizeof(struct bpf_insn);Doesn't the data need to be swapped?
+ memcpy(prog->insns, data,
+ prog->insns_cnt * sizeof(struct bpf_insn));
Thanks,
Namhyung
I'm not very sure, since they are instructions. Byte order of
instructions and byte order of data
are not always same. Think about ARM. Therefore another choice is to
swap them in kernel,
keep user-kernel interface clean.
Alexei Starovoitov, do you think we should use uniformed instruction
byte order in both big and little
endian kernel on user-kernel interface, or let userspace feed swapped
instructions to kernel if
endianess is not match?