about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCristian Rodríguez <crrodriguez@opensuse.org>2021-08-06 15:17:49 -0400
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-10-08 09:52:21 -0300
commitfa80ce6023c76dab34133d43f8c8f831a949fbf3 (patch)
tree8d2867246921fc24174f2d19c323ca81aed821ab
parentb5c8a3aa82f66f49b731ca5204104cee48bccfa5 (diff)
downloadglibc-fa80ce6023c76dab34133d43f8c8f831a949fbf3.tar.gz
glibc-fa80ce6023c76dab34133d43f8c8f831a949fbf3.tar.xz
glibc-fa80ce6023c76dab34133d43f8c8f831a949fbf3.zip
resolv: make res_randomid use random_bits()
It is at least "more random" than 0xffff & __getpid ();

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
-rw-r--r--resolv/res_randomid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/resolv/res_randomid.c b/resolv/res_randomid.c
index 546daf4c8b..366429c9f4 100644
--- a/resolv/res_randomid.c
+++ b/resolv/res_randomid.c
@@ -84,9 +84,10 @@
 
 #include <resolv.h>
 #include <unistd.h>
+#include <random-bits.h>
 
 unsigned int
 res_randomid (void) {
-  return 0xffff & __getpid ();
+  return 0xffff & random_bits ();
 }
 libc_hidden_def (__res_randomid)