[PATCH v3 1/4] pidns: move is-ancestor logic to helper