From: David Lamparter Date: Thu, 28 Jul 2016 15:23:38 +0000 (+0200) Subject: ospfd: use random() to pick initial DD seq# X-Git-Tag: frr-2.0-rc1~437 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=833a7ff9cc14b92caf36c48ea87e59f68037046c;p=mirror%2Ffrr.git ospfd: use random() to pick initial DD seq# 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 --- diff --git a/ospfd/ospf_nsm.c b/ospfd/ospf_nsm.c index 23d1e3fc6c..6fc7c266ac 100644 --- a/ospfd/ospf_nsm.c +++ b/ospfd/ospf_nsm.c @@ -783,7 +783,7 @@ nsm_change_state (struct ospf_neighbor *nbr, int state) 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++;