Opened 12 years ago
Last modified 11 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: | ||
Platform: | x86 |
Description
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.
Attachments (1)
Change History (5)
by , 12 years ago
comment:1 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
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.)
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.
comment:3 by , 11 years ago
Component: | Network & Internet/IPv4 → Network & Internet/Stack |
---|
I'm curious if this is how libbind is expected to behave or if something in our port is busted.
comment:4 by , 11 years ago
Component: | Network & Internet/Stack → Kits/Network Kit |
---|
Test code