Attention is currently required from: cron2, flichtenheld. Hello cron2, flichtenheld,
I'd like you to reexamine a change. Please visit http://gerrit.openvpn.net/c/openvpn/+/909?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review-1 by cron2 Change subject: Mention address if not unspecific on DNS failure ...................................................................... Mention address if not unspecific on DNS failure With the recent changes breaking configs that included lport 0, it became apparent that having the address family in the error message when resolving fails, would have made diagnosis in this case and probably others much easier. Change-Id: I1c8fcd5bb6e1fa0020d52879eefbafdb2630e7b5 Signed-off-by: Arne Schwabe <a...@rfc2549.org> --- M src/openvpn/socket.c 1 file changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/09/909/2 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 6b32e30..c5ed6b8 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -445,6 +445,22 @@ throw_signal_soft(SIGHUP, "Preresolving failed"); } +/** + * Small helper function for openvpn_getaddrinfo to print the address + * family when resolving fails + */ +static const char * +getaddrinfo_addr_family_name(int af) +{ + switch (af) + { + case AF_INET: return "[AF_INET]"; + + case AF_INET6: return "[AF_INET6]"; + } + return ""; +} + /* * Translate IPv4/IPv6 addr or hostname into struct addrinfo * If resolve error, try again for resolve_retry_seconds seconds. @@ -545,11 +561,11 @@ print_hostname = "undefined"; } - fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s)"; + fmt = "RESOLVE: Cannot resolve host address: %s:%s%s (%s)"; if ((flags & GETADDR_MENTION_RESOLVE_RETRY) && !resolve_retry_seconds) { - fmt = "RESOLVE: Cannot resolve host address: %s:%s (%s) " + fmt = "RESOLVE: Cannot resolve host address: %s:%s%s (%s) %s" "(I would have retried this name query if you had " "specified the --resolv-retry option.)"; } @@ -639,7 +655,8 @@ fmt, print_hostname, print_servname, - gai_strerror(status)); + getaddrinfo_addr_family_name(ai_family), + ai_strerror(status)); if (--resolve_retries <= 0) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/909?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I1c8fcd5bb6e1fa0020d52879eefbafdb2630e7b5 Gerrit-Change-Number: 909 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos <arne-open...@rfc2549.org> Gerrit-Reviewer: cron2 <g...@greenie.muc.de> Gerrit-Reviewer: flichtenheld <fr...@lichtenheld.com> Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net> Gerrit-Attention: cron2 <g...@greenie.muc.de> Gerrit-Attention: flichtenheld <fr...@lichtenheld.com> Gerrit-MessageType: newpatchset
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel