From fc6e9cf8b3ba97f404cf3ccd154b5239905c72d3 Mon Sep 17 00:00:00 2001 From: Joel Beckmeyer Date: Wed, 8 Nov 2023 13:38:15 -0500 Subject: [PATCH] don't print erroneous IP version --- ddclient.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ddclient.in b/ddclient.in index f38db33..a3586ab 100755 --- a/ddclient.in +++ b/ddclient.in @@ -2601,7 +2601,9 @@ sub geturl { debug("server = %s", $server); (my $_url = $url) =~ s%\?.*%?%; #redact possible credentials debug("url = %s", $_url); - debug("ip ver = %s", $ipversion); + if ($ipversion != 0) { + debug("ip ver = %s", $ipversion); + } if (!opt('exec')) { debug("skipped network connection"); @@ -2639,7 +2641,11 @@ sub geturl { verbose("RECEIVE:", "%s", $reply // ""); if (!$reply) { # don't include ${url} as that might expose login credentials - warning("curl cannot connect to %s://%s using IPv%s",${protocol},${server},$ipversion); + if ($ipversion != 0) { + warning("curl cannot connect to %s://%s using IPv%s",${protocol},${server},$ipversion); + } else { + warning("curl cannot connect to %s://%s",${protocol},${server}); + } } }