From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21903 invoked by alias); 12 Feb 2014 17:32:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 21893 invoked by uid 89); 12 Feb 2014 17:32:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f173.google.com Received: from mail-lb0-f173.google.com (HELO mail-lb0-f173.google.com) (209.85.217.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 12 Feb 2014 17:32:13 +0000 Received: by mail-lb0-f173.google.com with SMTP id s7so5756319lbd.4 for ; Wed, 12 Feb 2014 09:32:09 -0800 (PST) X-Received: by 10.152.8.47 with SMTP id o15mr32381495laa.20.1392226329699; Wed, 12 Feb 2014 09:32:09 -0800 (PST) Received: from home.pavel.comp (paulfertser.info. [2001:470:26:54b:250:70ff:fee7:41ec]) by mx.google.com with ESMTPSA id n1sm2014091lae.6.2014.02.12.09.32.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Feb 2014 09:32:09 -0800 (PST) Received: (from pavel@localhost) by home.pavel.comp (8.14.5/8.13.8) id s1CHW5q8032753; Wed, 12 Feb 2014 21:32:05 +0400 Date: Wed, 12 Feb 2014 17:32:00 -0000 From: Paul Fertser To: Jan Kratochvil Cc: Eli Zaretskii , gdb-patches@sourceware.org, ktietz@redhat.com Subject: Re: [PATCH v3] Add IPv6 support for outgoing remote TCP connections Message-ID: <20140212173205.GC26683@home.lan> References: <20140210195758.GA16956@host2.jankratochvil.net> <1392148089-18253-1-git-send-email-fercerpav@gmail.com> <20140212165318.GA8969@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140212165318.GA8969@host2.jankratochvil.net> User-Agent: Mutt/1.5.17 (2007-11-30) X-SW-Source: 2014-02/txt/msg00425.txt.bz2 Hi Jan, Thank you for the review! On Wed, Feb 12, 2014 at 05:53:18PM +0100, Jan Kratochvil wrote: > > +AC_SEARCH_LIBS(getaddrinfo, [socket network net], [], [], [-lnsl]) > > Where is it stated in gnulib? I could not find it. http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/getaddrinfo.m4;h=2e66584865e9b45c201219071a5abc454ef43937;hb=HEAD#l21 -lnsl is needed per Oracle getaddrinfo man page. > > #ifdef USE_WIN32API > > #include > > +#include > > Put there AC_CHECK_HEADERS for it unless someone confirms all MS-Windows hosts > really have that include file. I have no idea. Hm, ok, I'll try to come up with something justifiable here. > > + tmp = getaddrinfo (hostname, port_str, &hints, &result); > > + if (tmp) > > { > > fprintf_unfiltered (gdb_stderr, "%s: unknown host\n", hostname); > > It should use gai_strerror(). I understand you wrote > # In this patch I was trying to change current behaviour as little as > # possible. > It can be a separate patch 2/2 or even in this one. Ok. > > + for (rp = result; ; rp = rp->ai_next ? rp->ai_next : result) > > + { > > + scb->fd = gdb_socket_cloexec (rp->ai_family, rp->ai_socktype, > > + rp->ai_protocol); > > > > - if (scb->fd == -1) > > - return -1; > > + if (scb->fd == -1) > > + continue; > > Neither 'return -1' nor 'continue' are right here. It should not lock-up if > none of the sockets can be created, it should return so that the error gets > reported. Indeed, thank you for spotting this! So can it be fprintf_unfiltered + return -1 here? I'm still puzzled about native windows behaviour; at least when run with wine this code I proposed performs differently compared to GNU/Linux, but I think it is the case with the unmodified code too. -- Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software! mailto:fercerpav@gmail.com