]> granicus.if.org Git - curl/commitdiff
Fixed display of the interface bind address in the trace output when it's
authorDan Fandrich <dan@coneharvesters.com>
Mon, 28 Jul 2008 18:35:34 +0000 (18:35 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 28 Jul 2008 18:35:34 +0000 (18:35 +0000)
an IPv6 address.

lib/connect.c

index 92538fc77d22c8af0f4b900da6dc6a43957a9c40..6c736a42c112ec6b76ecf2f91ba9af2a992222ba 100644 (file)
@@ -340,9 +340,7 @@ static CURLcode bindlocal(struct connectdata *conn,
       if(h) {
         if(in == CURL_INADDR_NONE)
           /* convert the resolved address, sizeof myhost >= INET_ADDRSTRLEN */
-          Curl_inet_ntop(h->addr->ai_addr->sa_family,
-                         &((struct sockaddr_in*)h->addr->ai_addr)->sin_addr,
-                         myhost, sizeof myhost);
+          Curl_printable_address(h->addr, myhost, sizeof myhost);
         else
           /* we know data->set.device is shorter than the myhost array */
           strcpy(myhost, dev);