New commits:
commit 24807a81f0b1bb6de8587512fed740af69af168e
Author: D. Hugh Redelmeier <h...@mimosa.com>
Date:   Fri Apr 30 12:11:03 2021 -0400

    libswan: ttoaddress.c: make ttoaddress_dns more robust and simpler
    
    The nest of code calling tryname seemed to accidentally work because
    err was non-null (containing a no-longer relevant diagnostic from an
    earlier phase).
    
    Example 1:
        if (err && (suggested_af == AF_UNSPEC || suggested_af == AF_INET)) {
    didn't need to test err: it was guaranteed to be non-null.
    
    Example 2:
    -   if (err && (suggested_af == AF_UNSPEC || suggested_af == AF_INET6)) {
    only worked in the case suggested_af == AF_INET6 because err was
    guaranteed to be non-null (because the IPv4 code hadn't disturbed that 
value)
    
    This latter test would more reasonably be
    -   if ((err && suggested_af == AF_UNSPEC) || suggested_af == AF_INET6) {
    because that would only look at err if it were assigned by the v4 case.
    
    This change splits the two uses of "err" and simplifies the code calling 
tryname.

_______________________________________________
Swan-commit mailing list
Swan-commit@lists.libreswan.org
https://lists.libreswan.org/mailman/listinfo/swan-commit

Reply via email to