[Swan-commit] Changes to ref refs/heads/master

Andrew Cagney cagney at vault.libreswan.fi
Wed May 8 00:57:53 UTC 2019


New commits:
commit 229e2d24a4ce75794c4077baa004d20328fb4b25
Author: Andrew Cagney <cagney at 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.



More information about the Swan-commit mailing list