While the idea for this came the other way around - removing
quagga_time() - using random() is actually a better idea here. It's
seeded by time to begin with, but if ospfd restarts several times in a
short timespan it won't run straight into the same sequence number.
(Should also update the random seed to include microseconds so restarts
within a second use a different seq#)
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
if (state == NSM_ExStart)
{
if (nbr->dd_seqnum == 0)
- nbr->dd_seqnum = quagga_time (NULL);
+ nbr->dd_seqnum = (uint32_t)random ();
else
nbr->dd_seqnum++;