bpf-program: make bpf_program_load_kernel() idempotent
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Feb 2018 18:19:57 +0000 (19:19 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Feb 2018 15:43:36 +0000 (16:43 +0100)
commite0ad39fc52ed851974dd8f522a45a2539b524bed
tree28d8fddb276ef7891373abbc9a77d0b92fb3f569
parent72a1db0bb2820917f2dc08a40a6d8ab2404ec515
bpf-program: make bpf_program_load_kernel() idempotent

Let's "seal" off the BPF program as soo as bpf_program_load_kernel() is
called, which allows us to make it idempotent: since the program can't
be modified anymore after being turned into a kernel object it's safe to
shortcut behaviour if called multiple times.
src/basic/bpf-program.c