]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_pim.c
Merge pull request #6732 from opensourcerouting/printfrr-prep
[mirror_frr.git] / pimd / pim_pim.c
index a76fbed20338ad17919f96b61a1200b733fdf9c2..bf31d4e4505eea28e3a92b59942f9e0634cd1daa 100644 (file)
@@ -23,6 +23,7 @@
 #include "thread.h"
 #include "memory.h"
 #include "if.h"
+#include "network.h"
 
 #include "pimd.h"
 #include "pim_pim.h"
@@ -42,7 +43,6 @@
 #include "pim_bsm.h"
 
 static int on_pim_hello_send(struct thread *t);
-static int pim_hello_send(struct interface *ifp, uint16_t holdtime);
 
 static const char *pim_pim_msgtype2str(enum pim_msg_type type)
 {
@@ -501,6 +501,7 @@ void pim_sock_reset(struct interface *ifp)
        pim_ifp->pim_dr_num_nondrpri_neighbors =
                0; /* neighbors without dr_pri */
        pim_ifp->pim_dr_addr = pim_ifp->primary_address;
+       pim_ifp->am_i_dr = true;
 
        pim_ifstat_reset(ifp);
 }
@@ -689,7 +690,7 @@ static int hello_send(struct interface *ifp, uint16_t holdtime)
        return 0;
 }
 
-static int pim_hello_send(struct interface *ifp, uint16_t holdtime)
+int pim_hello_send(struct interface *ifp, uint16_t holdtime)
 {
        struct pim_interface *pim_ifp = ifp->info;
 
@@ -879,7 +880,7 @@ int pim_sock_add(struct interface *ifp)
        old_genid = pim_ifp->pim_generation_id;
 
        while (old_genid == pim_ifp->pim_generation_id)
-               pim_ifp->pim_generation_id = random();
+               pim_ifp->pim_generation_id = frr_weak_random();
 
        zlog_info("PIM INTERFACE UP: on interface %s ifindex=%d", ifp->name,
                  ifp->ifindex);