[Xorp-cvs] XORP cvs commit: xorp/libxorp

Ben Greear greearb at candelatech.com
Tue Apr 22 09:08:40 PDT 2008


Pavlin Radoslavov wrote:
> Bruce Simpson <bms at icir.org> wrote:
>
>   
>> CVSROOT:	/usr/local/www/data/cvs
>> Module name:	xorp
>> Changes by:	bms at chum.icir.org	2008-04-22 13:13:45 UTC
>>
>> XORP CVS repository
>>
>>
>> Modified files:
>> 	libxorp       random.c 
>>
>> Log message:
>> 	Fix an uninitialized variable warning in gcc 4.2.
>> 	
>> 	Obtained from:  XORP/OLSR
>> 	Sponsored by:   CenGen, Inc.
>>
>> Revision  Changes                              Path
>> 1.15      +2 -2;  commitid: e598480de48141a7;  xorp/libxorp/random.c
>>     
>
> Bruce,
>
> The above commit fixes the compilation error, but doesn't fix the
> problem.
> In the original code, variable "junk_seed" has been intentionally
> left uninitialized so when used it will increase the
> unpredictability in the randomness.
> In fact, "junk_seed" has been used to feed the unpredicted value
> into variable "junk" as a compiler work-around.
> Is there any way to rewrite the code to keep the gcc-4.2 compiler
> happy and keep junk_seed unintialized?
> E.g., maybe by using a pointer to "junk_seed" or an array of 1-2
> elements of type "long" or something like this.
>   
That's a scary way to get randomness (these things are usually the same 
between each
start of the system, I have found)...maybe pull from a /dev/random or 
similar
things on other OS?

Thanks,
Ben
> Thanks,
> Pavlin
>
> _______________________________________________
> Xorp-cvs mailing list
> Xorp-cvs at icir.org
> http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/xorp-cvs
>   


-- 
Ben Greear <greearb at candelatech.com> 
Candela Technologies Inc  http://www.candelatech.com




More information about the Xorp-cvs mailing list