[haiku-bugs] [Haiku] #8320: Problems with ping and gethostbyname function.

  • From: "dknoto" <trac@xxxxxxxxxxxx>
  • Date: Wed, 08 Feb 2012 16:21:52 -0000

#8320: Problems with ping and gethostbyname function.
-------------------------------------------------+-------------------------
 Reporter:  dknoto                               |        Owner:  zooey
     Type:  bug                                  |       Status:  new
 Priority:  normal                               |    Milestone:  R1
Component:  Network & Internet/IPv4              |      Version:
 Keywords:  ping, gethostbyname, irs.conf,       |  R1/Development
  hosts                                          |   Blocked By:
 Blocking:                                       |  Has a Patch:  0
 Platform:  x86                                  |
-------------------------------------------------+-------------------------
 I installed nightly snapshot hrev43696 on my real mchine Lenovo ThinkPad
 T400.
 System worked amazing but from time to time he had some mistakes. I found
 some
 problems with ping command and gethostbyname function. Ping after
 installation
 works perfectly. But I have, in my local network, hosts that has only
 local
 names. I found information  in this forum about how to setup local hosts
 names
 in file "/etc/host" by set configuration in file
 "/boot/common/settings/network/irs.conf". Observed that empty or filled
 file
 "irs.conf" generates following results:

 ~> ping 127.0.0.1
 error: unknown protocol icmp: error 0 [No error]
 ~> ping localhost
 error: unknown protocol icmp: error 0 [No error]

 I have written small console program, that only call the function
 gethostbyname
 and print her results:

 /Home/Projekty/Testy>./ghbn 127.0.0.1
 Host in "127.0.0.1"
         h_name == "127.0.0.1"
         h_addrtype == 1
         h_length == 4
         h_addr_list[0] == 127.0.0.1
 /Home/Projekty/Testy>./ghbn localhost
 Host in "localhost"
         gethostbyname( "localhost" ): Error, errno == 0, h_errno == 1.

 And h_errnp == 1 this is error HOST_NOT_FOUND.

 My /etc/host has values "127.0.0.1 localhost" and irs.conf is empty or has
 values "hosts local dns".

 After removed file irs.conf, ping and gethostbyname working correctly but
 only
 with dns.

 On Linux the test program works perfectly.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/8320>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: