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

D. Hugh Redelmeier hugh at vault.libreswan.fi
Fri Apr 30 16:27:46 UTC 2021


New commits:
commit 24807a81f0b1bb6de8587512fed740af69af168e
Author: D. Hugh Redelmeier <hugh at 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.



More information about the Swan-commit mailing list