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