• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: getaddrinfo for "localhost" gives a strange IP-address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getaddrinfo for "localhost" gives a strange IP-address


  • Subject: Re: getaddrinfo for "localhost" gives a strange IP-address
  • From: email@hidden (Jun-ichiro itojun Hagino)
  • Date: Wed, 13 Jun 2007 20:30:23 +0900 (JST)

> Hello,
>
>   In my imac  I've got this strange problem. Executing ruby's
> testsuite will take a very long time.
>   I've isolated the reason to resolving of "localhost" address. The
> ruby uses getaddrinfo.
>   At the end o fthis mailis a test code that show this strange
> behaviour.
>   Running it will give the following output
>
> ./test localhost
> resolving name=localhost
> family=30 sock_type=1 protocol=6 flags=0x0 canonname=(null)
> ip=::1 serv=0
> family=2 sock_type=1 protocol=6 flags=0x0 canonname=(null)
> ip=173.19.2.144 serv=0
> family=2 sock_type=1 protocol=6 flags=0x0 canonname=(null)
> ip=127.0.0.1 serv=0.
>
> Eg. the first localhost ip is "173.19.2.144". This IP is not
> configured in my mac. Here is the
> ifconfig -a

	hmm.  i cannot seem to repeat the symptom with my iMac G5 + OS 10.4.9
	with your sample program.  is there any way to detect libc version?

itojun@the author of "IPv6 network programming" book


itojun[imac-itojun-org:~] ./a.out
resolving name=localhost
family=30 sock_type=1 protocol=6 flags=0x0 canonname=(null)
ip=::1 serv=0
family=2 sock_type=1 protocol=6 flags=0x0 canonname=(null)
ip=127.0.0.1 serv=0
itojun[imac-itojun-org:~] ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	inet6 fe80::214:51ff:fe98:9f98%en0 prefixlen 64 scopeid 0x4
	inet 221.249.121.230 netmask 0xfffffff8 broadcast 221.249.121.231
	inet6 2001:240:501::214:51ff:fe98:9f98 prefixlen 64 autoconf
	ether 00:14:51:98:9f:98
	media: autoselect (1000baseT <full-duplex>) status: active
	supported media: none autoselect 10baseT/UTP <half-duplex> 10baseT/UTP <full-duplex> 10baseT/UTP <full-duplex,hw-loopback> 100baseTX <half-duplex> 100baseTX <full-duplex> 100baseTX <full-duplex,hw-loopback> 1000baseT <full-duplex> 1000baseT <full-duplex,hw-loopback> 1000baseT <full-duplex,flow-control> 1000baseT <full-duplex,flow-control,hw-loopback>
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 00:14:51:86:f0:19
	media: autoselect (<unknown type>) status: inactive
	supported media: autoselect
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
	lladdr 00:14:51:ff:fe:98:9f:98
	media: autoselect <full-duplex> status: inactive
	supported media: autoselect <full-duplex>
itojun[imac-itojun-org:~] uname -a
Darwin imac-itojun-org.local 8.9.0 Darwin Kernel Version 8.9.0: Thu Feb 22 20:54:07 PST 2007; root:xnu-792.17.14~1/RELEASE_PPC Power Macintosh powerpc
itojun[imac-itojun-org:~] ls -l /usr/lib/libc.dylib
lrwxr-xr-x   1 root  wheel  15 Dec 14 16:00 /usr/lib/libc.dylib -> libSystem.dylib
itojun[imac-itojun-org:~] ls -l /usr/lib/libSystem.dylib
lrwxr-xr-x   1 root  wheel  17 Dec 14 16:00 /usr/lib/libSystem.dylib -> libSystem.B.dylib
itojun[imac-itojun-org:~] ls -l /usr/lib/libSystem.B.dylib
-r-xr-xr-x   1 root  wheel  4406292 May 26 09:01 /usr/lib/libSystem.B.dylib
itojun[imac-itojun-org:~] md5 /usr/lib/libSystem.B.dylib
MD5 (/usr/lib/libSystem.B.dylib) = 25ee99bbf8ecce741b1be22a4417341b
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >getaddrinfo for "localhost" gives a strange IP-address (From: Ville Mattila <email@hidden>)

  • Prev by Date: Re: compiling cctools
  • Next by Date: Re: compiling cctools
  • Previous by thread: getaddrinfo for "localhost" gives a strange IP-address
  • Next by thread: How to be an apple developer without a Mac?
  • Index(es):
    • Date
    • Thread