]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
resolv: make res_randomid use random_bits()
authorCristian Rodríguez <crrodriguez@opensuse.org>
Fri, 6 Aug 2021 19:17:49 +0000 (15:17 -0400)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 8 Oct 2021 12:52:21 +0000 (09:52 -0300)
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>
resolv/res_randomid.c

index 546daf4c8b7574c3f5e0add84ac0424a6b0c7876..366429c9f4c0ea697ff34be2148f6508170c4d37 100644 (file)
 
 #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)