Improved seed for zcip

Denys Vlasenko vda.linux at googlemail.com
Fri Oct 31 22:47:06 UTC 2008


On Friday 31 October 2008 13:47, walter harms wrote:
> > I clearly hadn't thought this through fully.  Maybe different routing
> > tables can help?  Something like this:
> > 
> >    http://pontus.ullgren.com/view/Multiple_interfaces_on_the_same_subnet
> > 
> >>> -		memcpy(&t, (char*)&eth_addr + 2, 4);
> >>> +		memcpy(&t, (char*)&eth_addr + 2 + if_nametoindex(intf), 4);
> >> Oops... you added if_nametoindex() to the _address_!
> >> You had to add it to t here:
> >>>  		srand(t);
> >>>  	}
> > 
> > Yes, that was surely not my intention, but perhaps makes an even better
> > seed? ;-)
> 
> what is a about  gettimeofday() and tv_usec ? its time in microseconds
> and should add some "randomness". or even /dev/urandom with limits in portability.

Adding randomness is easy. But existing code deliberately
tries to pick the same seed across reboots.
It uses 32 lower bits of MAC now.

Adding interface number would retain this property, yes.

But I want to understand how multi-homed machine with many zcip's
is going to work wrt networking at all.
--
vda



More information about the busybox mailing list