[BusyBox-cvs] busybox/util-linux rdate.c,1.27,1.28

Erik Andersen andersen at busybox.net
Fri Oct 31 09:31:45 UTC 2003

Update of /var/cvs/busybox/util-linux
In directory winder:/tmp/cvs-serv32160/util-linux

Modified Files:
Log Message:
Rework wget, the xconnect interface, and its various clients
in order to fix the problems with round robin DNS reported
by Andrew Flegg:

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!


Index: rdate.c
RCS file: /var/cvs/busybox/util-linux/rdate.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- rdate.c	9 Oct 2003 11:38:44 -0000	1.27
+++ rdate.c	31 Oct 2003 09:31:42 -0000	1.28
@@ -47,17 +47,16 @@
 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 */
 	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);

More information about the busybox-cvs mailing list