]> git.proxmox.com Git - mirror_frr.git/commit
ripd, ripngd: fix cleaning up of offset lists
authorRenato Westphal <renato@opensourcerouting.org>
Thu, 18 Apr 2019 15:32:19 +0000 (12:32 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Apr 2019 19:09:50 +0000 (16:09 -0300)
commit6c4c3561fe07a0f388aba938643d8932450f8be1
treec2dfe94051db85896f9ca87f7743704d31a96f8b
parentc02a40c14fec005d419ad1dbd3fac0e9521b9c6f
ripd, ripngd: fix cleaning up of offset lists

We should never attempt to remove a list item in the "del" callback
of the list. This is already performed by the list_delete() function,
doing it twice leads to crashes or memory corruption.

Introduce the offset_list_free() function so that we can separate the
removal and deallocation of offset lists into separate functions,
without code duplication. offset_list_del() will be used by the
northbound callbacks to remove offset lists, while offset_list_free()
will be used by rip_clean() to clean up all RIP offset lists using
list_delete(). Do the same for ripngd.

This is a fallout from the ripd/ripngd northbound conversion.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripd/rip_offset.c
ripd/ripd.c
ripd/ripd.h
ripngd/ripng_offset.c
ripngd/ripngd.c
ripngd/ripngd.h