cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-498156 ] Test 20 fails on 64-bit solaris (7.9.2)

From: <noreply_at_sourceforge.net>
Date: Mon, 31 Dec 2001 11:30:13 -0800

Bugs item #498156, was opened at 2001-12-31 11:30
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=498156&group_id=976

Category: libcurl
Group: wrong behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Philip Gladstone (philipjsg)
Assigned to: Daniel Stenberg (bagder)
Summary: Test 20 fails on 64-bit solaris (7.9.2)

Initial Comment:
Test 20 (behaviour with bad hostname) fails when curl is built with CC=cc and CFLAGS=-xarch=v9
(i.e. 64-bit solaris).

This turns out to be due to code in Curl_getaddrinfo in lib/hostip.c

In particular, the function inet_addr returns -1 which is then assigned to an unsigned long (giving
0x00000000ffffffff). This is then compared against 0xffffffffffffffff, and returns unequal, so the
code thinks that the address is valid.

My fix (for what it is worth) is to change the type of 'in' to in_addr_t and change the type of
INADDR_NONE to be (in_addr_t).

Similar code is in lib/connect.c

I'm not sending a patch as I don't know (really) how this ought to be fixed in the most portable
way. [I fear that in_addr_t is not a very portable type]

----------------------------------------------------------------------

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=498156&group_id=976
Received on 2001-12-31