summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-12-02 23:20:58 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2009-12-02 23:20:58 (GMT)
commit6a110c969f357d5ab3503660c6404a1ee9d916eb (patch)
tree1b340877fc1ff3d8ae26e8709e84f05eb87782b9
parent7cb1d6ccf36eccb294bd26e1c6da6866e7fc0ab7 (diff)
downloadbusybox-6a110c969f357d5ab3503660c6404a1ee9d916eb.tar.gz
busybox-6a110c969f357d5ab3503660c6404a1ee9d916eb.tar.bz2
ntpd: remove dynamic dns resolution code, too complex. -69 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ntpd.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/networking/ntpd.c b/networking/ntpd.c
index 375f009..ca79e03 100644
--- a/networking/ntpd.c
+++ b/networking/ntpd.c
@@ -108,7 +108,6 @@ typedef struct {
#define OFFSET_ARRAY_SIZE 8
typedef struct {
len_and_sockaddr *lsa;
- char *hostname;
char *dotted;
/* When to send new query (if fd == -1)
* or when receive times out (if fd >= 0): */
@@ -166,24 +165,14 @@ set_next(ntp_peer_t *p, unsigned t)
p->next_action_time = time(NULL) + t;
}
-static len_and_sockaddr*
-resolve_hostname(ntp_peer_t *p)
-{
- p->lsa = host2sockaddr(p->hostname, 123);
- if (p->lsa)
- p->dotted = xmalloc_sockaddr2dotted_noport(&p->lsa->u.sa);
- return p->lsa;
-}
-
static void
add_peers(char *s)
{
ntp_peer_t *p;
p = xzalloc(sizeof(*p));
- p->hostname = s;
- p->dotted = s;
- resolve_hostname(p);
+ p->lsa = xhost2sockaddr(s, 123);
+ p->dotted = xmalloc_sockaddr2dotted_noport(&p->lsa->u.sa);
p->fd = -1;
p->msg.m_status = MODE_CLIENT | (NTP_VERSION << 3);
p->trustlevel = TRUSTLEVEL_PATHETIC;
@@ -307,15 +296,6 @@ send_query_to_peer(ntp_peer_t *p)
int fd, family;
len_and_sockaddr *local_lsa;
-//TODO: big ntpd uses all IPs, not just 1st, do we need to mimic that?
-//TODO: periodically re-resolve DNS names?
- if (!p->lsa) {
- if (!resolve_hostname(p)) {
- set_next(p, INTERVAL_QUERY_PATHETIC);
- return -1;
- }
- }
-
family = p->lsa->u.sa.sa_family;
p->fd = fd = xsocket_type(&local_lsa, family, SOCK_DGRAM);
/* local_lsa has "null" address and port 0 now.