rip(ng)d_instance_disable unlinks the vrf from the instance which means
that rip(ng)_interfaces_clean never works, because rip(ng)->vrf is
always NULL there. This leads to the crash #6477.
Clean interfaces before disabling the instance to fix the issue.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
/* Delete all added rip route. */
void rip_clean(struct rip *rip)
{
+ rip_interfaces_clean(rip);
+
if (rip->enabled)
rip_instance_disable(rip);
route_table_finish(rip->enable_network);
vector_free(rip->passive_nondefault);
list_delete(&rip->offset_list_master);
- rip_interfaces_clean(rip);
route_table_finish(rip->distance_table);
RB_REMOVE(rip_instance_head, &rip_instances, rip);
/* delete all the added ripng routes. */
void ripng_clean(struct ripng *ripng)
{
+ ripng_interface_clean(ripng);
+
if (ripng->enabled)
ripng_instance_disable(ripng);
agg_table_finish(ripng->enable_network);
vector_free(ripng->passive_interface);
list_delete(&ripng->offset_list_master);
- ripng_interface_clean(ripng);
RB_REMOVE(ripng_instance_head, &ripng_instances, ripng);
XFREE(MTYPE_RIPNG_VRF_NAME, ripng->vrf_name);