[PATCH 07/28] gss_krb5: Use random value to initialize confounder
Kevin Coffman
kwc at citi.umich.edu
Mon Mar 31 13:49:23 EDT 2008
On Mon, Mar 31, 2008 at 12:24 PM, Kevin Coffman <kwc at citi.umich.edu> wrote:
> On Mon, Mar 31, 2008 at 11:26 AM, Chuck Lever <chuck.lever at oracle.com> wrote:
> > On Mar 31, 2008, at 10:31 AM, Kevin Coffman wrote:
> > > {
> > > static u64 i = 0;
> > > u64 *q = (u64 *)p;
> > > @@ -102,8 +102,19 @@ make_confounder(char *p, int blocksize)
> > > * uniqueness would mean worrying about atomicity and rollover,
> > > and I
> > > * don't care enough. */
> > >
> > > - BUG_ON(blocksize != 8);
> > > - *q = i++;
> > > + /* initialize to random value */
> > > + if (i == 0) {
> > > + i = random32();
> > > + i = (i << 32) | random32();
> > > + }
> >
> > Nit: The RPC layer usually uses net_random() instead of calling
> > random32() directly.
>
> O.K.
Hmmm. Is it worth including <linux/net.h> here to get the definition
of net_random()? (Which is currently a #define to random32).
More information about the NFSv4
mailing list