diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-09-05 06:47:43 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-09-05 06:47:43 +0000 |
commit | fcaea48fef6d82c56461654248e97d0816431d2e (patch) | |
tree | c57e973a9eae75380ec45186a474b5b8cc590c70 /resolv | |
parent | 4c7854d1dce24e8cc344f1da81fca01ee7f01804 (diff) |
Updated to fedora-glibc-20060905T0633cvs/fedora-glibc-2_4_90-29
Diffstat (limited to 'resolv')
-rw-r--r-- | resolv/res_init.c | 5 | ||||
-rw-r--r-- | resolv/res_mkquery.c | 12 |
2 files changed, 5 insertions, 12 deletions
diff --git a/resolv/res_init.c b/resolv/res_init.c index f881060d58..b5a03d1883 100644 --- a/resolv/res_init.c +++ b/resolv/res_init.c @@ -537,10 +537,7 @@ net_mask(in) /* XXX - should really use system's version of this */ u_int res_randomid(void) { - struct timeval now; - - __gettimeofday(&now, NULL); - return (0xffff & (now.tv_sec ^ now.tv_usec ^ __getpid())); + return 0xffff & __getpid(); } #ifdef _LIBC libc_hidden_def (__res_randomid) diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c index 4d98b8c5e8..fd80569fe2 100644 --- a/resolv/res_mkquery.c +++ b/resolv/res_mkquery.c @@ -124,24 +124,20 @@ res_nmkquery(res_state statp, incremented by one after the initial randomization which still predictable if the application does multiple requests. */ -#if 0 - hp->id = htons(++statp->id); -#else - hp->id = htons(statp->id); int randombits; do { -# ifdef RANDOM_BITS +#ifdef RANDOM_BITS RANDOM_BITS (randombits); -# else +#else struct timeval tv; __gettimeofday (&tv, NULL); randombits = (tv.tv_sec << 8) ^ tv.tv_usec; -# endif +#endif } while ((randombits & 0xffff) == 0); statp->id = (statp->id + randombits) & 0xffff; -#endif + hp->id = statp->id; hp->opcode = op; hp->rd = (statp->options & RES_RECURSE) != 0; hp->rcode = NOERROR; |