From 94911d4cc3741df95fef45e0cceed1ebc311404b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 25 Jul 2009 21:23:39 +0200 Subject: Don’t perror("connect") when there most likely is no IPv6 connectivity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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; } -- cgit v1.2.3