[PATCH OLK-6.6 v3 4/7] bpf: Extract internal structs validation logic into helpers