From 94911d4cc3741df95fef45e0cceed1ebc311404b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 25 Jul 2009 21:23:39 +0200 Subject: [PATCH] =?utf8?q?Don=E2=80=99t=20perror("connect")=20when=20there?= =?utf8?q?=20most=20likely=20is=20no=20IPv6=20connectivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/get_ipv6_addr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/get_ipv6_addr.c b/src/get_ipv6_addr.c index 2fd978b..aa09d3a 100644 --- a/src/get_ipv6_addr.c +++ b/src/get_ipv6_addr.c @@ -41,7 +41,10 @@ const char *get_ipv6_addr() { * it saves the local address with which packets would * be sent to the destination. */ if (connect(fd, resp->ai_addr, resp->ai_addrlen) == -1) { - perror("connect()"); + /* We don’t display the error here because most + * likely, there just is no IPv6 connectivity. + * Thus, don’t spam the user’s console but just + * try the next address. */ (void)close(fd); continue; } -- 2.39.5