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