summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaravanank <saravanank@vmware.com>2020-03-17 19:22:57 -0700
committersaravanank <saravanank@vmware.com>2020-03-18 21:41:04 -0700
commitb3a474d82eb9ff39e53d97597e59fe72d0d13f97 (patch)
treeccefcbf4ef310a92da00c1f050d9efee5cc11576
parent7f2ccbe562cae49fb8bf1770a0ec79b701ee41af (diff)
pimd: pimd crashes during neighbor clean up
RCA: It has asserted because during neighbor delete on a interface, pim_number_of_nonlandelay_neighbors count has become less less than 0. This was due to not updating the count when hello option changed. Fix: During hello option update, check and increment or decrement when this option changes. Signed-off-by: Saravanan K <saravanank@vmware.com>
-rw-r--r--pimd/pim_neighbor.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/pimd/pim_neighbor.c b/pimd/pim_neighbor.c
index ca7ca11402..d8a797f980 100644
--- a/pimd/pim_neighbor.c
+++ b/pimd/pim_neighbor.c
@@ -779,6 +779,7 @@ void pim_neighbor_update(struct pim_neighbor *neigh,
uint32_t dr_priority, struct list *addr_list)
{
struct pim_interface *pim_ifp = neigh->interface->info;
+ uint32_t old, new;
/* Received holdtime ? */
if (PIM_OPTION_IS_SET(hello_options, PIM_OPTION_MASK_HOLDTIME)) {
@@ -818,6 +819,16 @@ void pim_neighbor_update(struct pim_neighbor *neigh,
neigh->prefix_list = addr_list;
update_dr_priority(neigh, hello_options, dr_priority);
+ new = PIM_OPTION_IS_SET(hello_options, PIM_OPTION_MASK_LAN_PRUNE_DELAY);
+ old = PIM_OPTION_IS_SET(neigh->hello_options,
+ PIM_OPTION_MASK_LAN_PRUNE_DELAY);
+
+ if (old != new) {
+ if (old)
+ ++pim_ifp->pim_number_of_nonlandelay_neighbors;
+ else
+ --pim_ifp->pim_number_of_nonlandelay_neighbors;
+ }
/*
Copy flags
*/