[haiku-development] Problems with ping and gethostbyname function.

  • From: Dariusz Knociński <dknoto@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 7 Feb 2012 19:13:08 +0100

Hi all,

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.

Best Regards
Dariusz Knociński.

Other related posts: