summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 07c4172f22..b25b6eaa8c 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -28,6 +28,7 @@
#include "plist.h"
#include "hash.h"
#include "ferr.h"
+#include "network.h"
#include "pimd.h"
#include "pim_instance.h"
@@ -900,15 +901,16 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
* So let's grab the loopbacks v4 address
* and use that as the primary address
*/
- if (!v4_addrs && v6_addrs && !if_is_loopback(ifp)) {
+ if (!v4_addrs && v6_addrs) {
struct interface *lo_ifp;
+
// DBS - Come back and check here
if (ifp->vrf_id == VRF_DEFAULT)
lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
else
lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
- if (lo_ifp)
+ if (lo_ifp && (lo_ifp != ifp))
return pim_find_primary_addr(lo_ifp);
}
@@ -1102,7 +1104,8 @@ int pim_if_t_override_msec(struct interface *ifp)
effective_override_interval_msec =
pim_if_effective_override_interval_msec(ifp);
- t_override_msec = random() % (effective_override_interval_msec + 1);
+ t_override_msec =
+ frr_weak_random() % (effective_override_interval_msec + 1);
return t_override_msec;
}
@@ -1180,7 +1183,7 @@ long pim_if_t_suppressed_msec(struct interface *ifp)
return 0;
/* t_suppressed = t_periodic * rand(1.1, 1.4) */
- ramount = 1100 + (random() % (1400 - 1100 + 1));
+ ramount = 1100 + (frr_weak_random() % (1400 - 1100 + 1));
t_suppressed_msec = router->t_periodic * ramount;
return t_suppressed_msec;