[CIPSO]: remove duplicated code in the cipso_v4_*_getattr() functions