[PATCH 2/2] resolv: make res_randomid use random_bits()
Cristian Rodríguez
crrodriguez@opensuse.org
Thu Aug 12 18:51:09 GMT 2021
Ping..
On Fri, Aug 6, 2021 at 3:18 PM Cristian Rodríguez
<crrodriguez@opensuse.org> wrote:
>
> It is at least "more random" than 0xffff & __getpid ();
>
> Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
> ---
> resolv/res_randomid.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/resolv/res_randomid.c b/resolv/res_randomid.c
> index 546daf4c8b..08a52a111a 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 random_bits();
> }
> libc_hidden_def (__res_randomid)
> --
> 2.32.0
More information about the Libc-alpha
mailing list