New commits: commit 229e2d24a4ce75794c4077baa004d20328fb4b25 Author: Andrew Cagney <cag...@gnu.org> Date: Tue May 7 16:40:39 2019 -0400
state: simplify IS_IKE_SA() making IS_PARENT_SA() redundant Given: #define IS_CHILD_SA(st) ((st)->st_clonedfrom != SOS_NOBODY) #define IS_PARENT_SA(st) (!IS_CHILD_SA(st)) #define IS_IKE_SA(st) ( ((st)->st_clonedfrom == SOS_NOBODY) && \ (IS_PHASE1((st)->st_state) || IS_PHASE15((st)->st_state) || IS_PARENT_SA(st)) ) both IS_IKE_SA() and IS_PARENT_SA() can be reduced to: #define IS_IKE_SA(st) ((st)->st_clonedfrom == SOS_NOBODY) Clarifies code so that confusingly redundant sequences such as: if (IS_CHILD_SA(pst)) return; ... if (st->st_clonedfrom == pst->st_serialno) ... if (!IS_IKE_SA(pst)) return; if (st->st_clonedfrom == pst->st_serialno) ... found in flush_pending_child() can be eliminated. _______________________________________________ Swan-commit mailing list Swan-commit@lists.libreswan.org https://lists.libreswan.org/mailman/listinfo/swan-commit