core: constify bpf program arrays

In cases where the programs were modified after being initially declared,
reorder operations so that the declaration is already in final form.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-11-10 23:22:14 +01:00
parent 754499fab2
commit 2899aac46a
3 changed files with 48 additions and 54 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ static bool can_memlock(void) {
}
int main(int argc, char *argv[]) {
struct bpf_insn exit_insn[] = {
const struct bpf_insn exit_insn[] = {
BPF_MOV64_IMM(BPF_REG_0, 0), /* drop */
BPF_EXIT_INSN()
};