diff options
Diffstat (limited to 'ospfd/ospf_lsa.c')
| -rw-r--r-- | ospfd/ospf_lsa.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index 088f7f31c7..d089ea76cd 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -33,6 +33,7 @@ #include "hash.h" #include "sockunion.h" /* for inet_aton() */ #include "checksum.h" +#include "network.h" #include "ospfd/ospfd.h" #include "ospfd/ospf_interface.h" @@ -298,7 +299,8 @@ const char *dump_lsa_key(struct ospf_lsa *lsa) strlcpy(id, inet_ntoa(lsah->id), sizeof(id)); strlcpy(ar, inet_ntoa(lsah->adv_router), sizeof(ar)); - sprintf(buf, "Type%d,id(%s),ar(%s)", lsah->type, id, ar); + snprintf(buf, sizeof(buf), "Type%d,id(%s),ar(%s)", lsah->type, + id, ar); } else strlcpy(buf, "NULL", sizeof(buf)); @@ -3523,7 +3525,8 @@ void ospf_refresher_register_lsa(struct ospf *ospf, struct ospf_lsa *lsa) * 1680s * and 1740s. */ - delay = (random() % (max_delay - min_delay)) + min_delay; + delay = (frr_weak_random() % (max_delay - min_delay)) + + min_delay; current_index = ospf->lsa_refresh_queue.index + (monotime(NULL) - ospf->lsa_refresher_started) |
