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