mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-02-01 18:56:52 +00:00
ospf6d: upon interface deletion, the area if list may be updated
there are some events where the list of interfaces per area should be reviewed due to an interface is being removed. This fix avoids having some memory leak. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
parent
d51884e6e1
commit
22b982dfe9
@ -1022,3 +1022,16 @@ void ospf6_area_init(void)
|
||||
install_element(OSPF6_NODE, &area_filter_list_cmd);
|
||||
install_element(OSPF6_NODE, &no_area_filter_list_cmd);
|
||||
}
|
||||
|
||||
void ospf6_area_interface_delete(struct ospf6_interface *oi)
|
||||
{
|
||||
struct ospf6_area *oa;
|
||||
struct listnode *node, *nnode;
|
||||
|
||||
if (!ospf6)
|
||||
return;
|
||||
for (ALL_LIST_ELEMENTS(ospf6->area_list, node, nnode, oa))
|
||||
if(listnode_lookup(oa->if_list, oi))
|
||||
listnode_delete(oa->if_list, oi);
|
||||
|
||||
}
|
||||
|
||||
@ -132,5 +132,7 @@ extern void ospf6_area_show(struct vty *, struct ospf6_area *);
|
||||
extern void ospf6_area_plist_update(struct prefix_list *plist, int add);
|
||||
extern void ospf6_area_config_write(struct vty *vty);
|
||||
extern void ospf6_area_init(void);
|
||||
struct ospf6_interface;
|
||||
extern void ospf6_area_interface_delete(struct ospf6_interface *oi);
|
||||
|
||||
#endif /* OSPF_AREA_H */
|
||||
|
||||
@ -269,6 +269,9 @@ void ospf6_interface_delete(struct ospf6_interface *oi)
|
||||
|
||||
ospf6_bfd_info_free(&(oi->bfd_info));
|
||||
|
||||
/* disable from area list if possible */
|
||||
ospf6_area_interface_delete(oi);
|
||||
|
||||
XFREE(MTYPE_OSPF6_IF, oi);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user