diff options
author | Paul Jakma <paul@jakma.org> | 2015-09-08 16:31:45 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-05-26 17:33:31 +0200 |
commit | cdd0c84970dfa98e0232011eb7c7241805c9e4eb (patch) | |
tree | 33e7df5bbeb354f33b5e3a7e90a6f88b12a814eb /ospfd/ospf_interface.c | |
parent | isisd: Add new adjacency to LSP neighbor list (diff) | |
download | frr-cdd0c84970dfa98e0232011eb7c7241805c9e4eb.tar.xz frr-cdd0c84970dfa98e0232011eb7c7241805c9e4eb.zip |
ospfd: Fix bug in 94266fa822ba, nbr_self rebuild didn't add valid nbr_self
* 94266fa822ba "ospfd: Self nbrs needs to be rebuilt when router ID changes."
deleted the nbr_self, and added it back, but ospf_nbr_add_self doesn't
actually create the nbr_self - it assumes it's already there. Leading
to use after free and crashes after a router-id change.
* ospfd/ospf_neighbor.{c,h}: (ospf_nbr_self_reset) Little helper to reset the
nbr_self correctly.
* ospf_interface.c: (ospf_if_cleanup) moved code to ospf_nbr_self_reset
* ospfd.c: (ospf_router_id_update) Use ospf_nbr_self_reset instead of doing
the reset badly, fixing 94266fa822ba.
(cherry picked from commit c920e510d09c6c4ab63a3da5375009442a950f82)
Diffstat (limited to 'ospfd/ospf_interface.c')
-rw-r--r-- | ospfd/ospf_interface.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 628091963..5b6be1c8d 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -297,9 +297,7 @@ ospf_if_cleanup (struct ospf_interface *oi) ospf_ls_upd_queue_empty (oi); /* Reset pseudo neighbor. */ - ospf_nbr_delete (oi->nbr_self); - oi->nbr_self = ospf_nbr_new (oi); - ospf_nbr_add_self (oi); + ospf_nbr_self_reset (oi); } void |