During vrf delete, the vxlan_info.work_list
linked list was deleted which is a global list
containing the SGs for all the VRFs.
If two vrfs are configured, vrf a and vrf b and
both has SGs assocaited with them which are
inserted in the vxlan_info.work_list. Now if
vrf a is deleted, it deletes the work_list also.
Due to this when any SG add or del comes for vrf b
it tries to access the work_list and crashes.
Fix
Delete the vxlan_info.work_list only when all the
VRFs are terminated and unset the vxlan_info.flags
so if new add cmd comes it re-allocates the work_list.
Signed-off-by: usrivastava-nvidia <usrivastava@nvidia.com>
(cherry picked from commit
b88cce233043806129eb6d8c938655b2886ec898)
}
vrf_terminate();
+ /* Delete the vxlan_info.work_list as all the VRFs are deleted*/
+ pim_vxlan_work_list_delete();
}
{
hash_clean_and_free(&pim->vxlan.sg_hash,
(void (*)(void *))pim_vxlan_sg_del_item);
+}
- if (vxlan_info.work_list)
+void pim_vxlan_work_list_delete(void)
+{
+ if (vxlan_info.work_list) {
list_delete(&vxlan_info.work_list);
+ UNSET_FLAG(vxlan_info.flags, PIM_VXLANF_WORK_INITED);
+ }
}
void pim_vxlan_terminate(void)
extern void pim_vxlan_init(struct pim_instance *pim);
extern void pim_vxlan_exit(struct pim_instance *pim);
+void pim_vxlan_work_list_delete(void);
#endif /* PIM_VXLAN_INSTANCE_H */