[SSSD] [PATCH] Sort SRV replies according to RFC 2782

Jakub Hrozek jhrozek at redhat.com
Thu Apr 22 16:25:20 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/22/2010 02:43 PM, Stephen Gallagher wrote:
> Nack.
> 
> While this is clearly not a case where random values need to be highly 
> random, on some implementations rand() is not uniformly distributed in 
> the low-order bits. In order to be more portable, we should use
> 
> selected = (int)((total + 1) * (rand()/(RAND_MAX + 1.0)))

Thanks for the suggestion, a new patch is attached, also fixes a
whitespace issue.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkvQeHAACgkQHsardTLnvCUiSwCfSVIOBeFQ3w+jsusHLWzddJwI
MwAAniAJd8ZpVqU0+Nl4NYHunJAmlxoC
=Gx8T
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Sort-SRV-replies-according-to-RFC-2782.patch
Type: text/x-patch
Size: 11006 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100422/6a352d59/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Sort-SRV-replies-according-to-RFC-2782.patch.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20100422/6a352d59/attachment.sig>


More information about the sssd-devel mailing list