Opened 7 years ago

Last modified 6 years ago

#8320 assigned bug

Problems with ping and gethostbyname function.

Reported by: dknoto Owned by: nobody
Priority: normal Milestone: R1
Component: Kits/Network Kit Version: R1/Development
Keywords: ping, gethostbyname, irs.conf, hosts Cc:
Blocked By: Blocking:
Has a Patch: no 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 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 Host in ""

h_name == "" h_addrtype == 1 h_length == 4 h_addr_list[0] ==

/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 " 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.

Attachments (1)

ghbn.c (1.3 KB) - added by dknoto 7 years ago.
Test code

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by dknoto

Attachment: ghbn.c added

Test code

comment:1 Changed 7 years ago by zooey

Owner: changed from zooey to nobody
Status: newassigned

comment:2 Changed 6 years ago by Ziusudra

Adding the line protocols local to irs.conf fixes this. (I didn't try the test program but it can be assumed to work.)

My complete irs.conf is:

hosts local continue
hosts dns
protocols local

With this, the hosts file Disreali attached to #7362 works as expected for both Web+ and Terminal programs (ping/traceroute). (The MVPS hosts file mentioned by Matt fails to resolve anything. I haven't yet looked into why that may be. Edit: as augiedoggie says in that ticket converting the line endings fixes that hosts file)

The irs.conf and hosts files both have to be in /boot/common/settings/network/. A protocols file is not needed. No other files need to be added/modified.

Last edited 6 years ago by Ziusudra (previous) (diff)

comment:3 Changed 6 years ago by mmadia

Component: Network & Internet/IPv4Network & Internet/Stack

I'm curious if this is how libbind is expected to behave or if something in our port is busted.

comment:4 Changed 6 years ago by mmadia

Component: Network & Internet/StackKits/Network Kit
Note: See TracTickets for help on using tickets.