summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorEric Andersen2003-10-31 09:31:46 +0000
committerEric Andersen2003-10-31 09:31:46 +0000
commite6dc439b3a3fa2a64f9e938ac4e5810025c04242 (patch)
treebacb9f48301189de134d9f8edc2f1f45c65086c5 /util-linux
parent8179cf2b78a508a350c7497c1e234376f20f418f (diff)
downloadbusybox-e6dc439b3a3fa2a64f9e938ac4e5810025c04242.zip
busybox-e6dc439b3a3fa2a64f9e938ac4e5810025c04242.tar.gz
Rework wget, the xconnect interface, and its various clients
in order to fix the problems with round robin DNS reported by Andrew Flegg: http://busybox.net/lists/busybox/2003-October/009579.html This removes the ipv6 specific xconnect dns lookups. I do not see why that would need to be special cased for ipv6 as was done, but that will just have to be tested. So IPV6 people -- please test this change! -Erik
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/rdate.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 8d156cc..a822f42 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -47,17 +47,16 @@ static void socket_timeout(int sig)
static time_t askremotedate(const char *host)
{
unsigned long int nett, localt;
- const char *port="37";
+ struct sockaddr_in addr s_in;
int fd;
- if (getservbyname("time", "tcp") != NULL)
- port="time";
+ bb_lookup_host(&s_in, host, "time");
/* Add a timeout for dead or non accessable servers */
alarm(10);
signal(SIGALRM, socket_timeout);
- fd = xconnect(host, port);
+ fd = xconnect(s_in);
if (safe_read(fd, (void *)&nett, 4) != 4) /* read time from server */
bb_error_msg_and_die("%s did not send the complete time", host);