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