hush/networking
Michael Tokarev e9355c4326 hostname: do not use gethostbyname() for "hostname -s"
There's no reason to call gethostbyname() on the value returned
by uname() when asked just for a short name of a host.  This may
also be wrong, when uname is set to one value, but in /etc/hosts
(or elsewhere) the "canonical" name is different.  This is often
the case for localhost entry in /etc/hosts:

  127.0.0.1     localhost       myname

With this content of /etc/hosts, and uname being set to myname,
busybox hostname -s will return localhost, while regular
hostname utility returns myname.

Fix this by not calling gethostbyname() for the simple
'hostname -s' use.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-12-17 19:13:45 +01:00
..
libiproute iplink: comment out include <net/if_packet.h> 2013-08-16 12:20:25 +02:00
udhcp udhcp: add PXELINUX config file option (code 209) definition 2013-11-12 11:18:26 +01:00
arp.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
arping.c
brctl.c
Config.src wget: add support for connect timeout 2013-10-12 21:47:07 +02:00
dnsd.c
ether-wake.c ether-wake: shorten help text, reduce packet buffer size 2013-10-14 19:04:20 +02:00
ftpd.c
ftpgetput.c
hostname.c hostname: do not use gethostbyname() for "hostname -s" 2013-12-17 19:13:45 +01:00
httpd_indexcgi.c
httpd_post_upload.txt
httpd_ssi.c
httpd.c httpd: make sire pfd[TO_CGI].revents is cleared before poll() 2013-09-18 12:08:41 +02:00
ifconfig.c fix build error with musl libc due to if_slip.h 2013-08-15 09:54:51 +02:00
ifenslave.c
ifplugd.c ifplugd: use a larger netlink buffer 2013-08-04 18:10:26 +02:00
ifupdown.c ifupdown: support "source" stanza in /etc/network/interfaces 2013-02-28 19:01:28 +01:00
inetd.c
interface.c networking: fix potential overflow in ife_print6() 2013-08-14 17:43:05 +02:00
ip.c
ipcalc.c
isrv_identd.c
isrv.c
isrv.h
Kbuild.src
nameif.c
nbd-client.c
nc_bloaty.c nc: remove unnecessary "errno = 0" 2013-07-29 14:18:32 +02:00
nc.c nc: use symbolic SHUT_WR instead of literal 1 2013-07-28 21:08:37 +02:00
netstat.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
nslookup.c nslookup: set default DNS server again. Hopefully helps with 675 2013-06-27 01:09:51 +02:00
ntpd_simple.c libbb: introduce and use strftime_[YYYYMMDD]HHMMSS() 2013-03-29 12:30:33 +01:00
ntpd.c ntpd: speed up resyncing if our clock is seriously off 2013-12-08 16:11:04 +01:00
ping.c ping: try SOCK_DGRAM if no root privileges 2013-11-28 12:50:25 +01:00
pscan.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
route.c
slattach.c
tc.c fix assorted unused code and wrong format specs found by cppchekc (bug 6716) 2013-11-29 16:43:33 +01:00
tcpudp_perhost.c
tcpudp_perhost.h
tcpudp.c
telnet.c telnet: code shrink 2013-05-12 02:13:24 +02:00
telnetd.c
telnetd.ctrlSQ.patch
tftp.c
traceroute.c fix assorted unused code and wrong format specs found by cppchekc (bug 6716) 2013-11-29 16:43:33 +01:00
tunctl.c
vconfig.c
wget.c wget: user-friendly fallback to http 2013-12-17 19:09:43 +01:00
whois.c
zcip.c