Merge pull request #13900 from donaldsharp/neighbor_structure_crash

ospf6d: Fix crash because neighbor structure was freed
This commit is contained in:
Donatas Abraitis 2023-07-03 09:21:46 +03:00 committed by GitHub
commit c738d8db03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -2533,7 +2533,8 @@ void ospf6_lsreq_send(struct event *thread)
/* schedule loading_done if request list is empty */ /* schedule loading_done if request list is empty */
if (on->request_list->count == 0) { if (on->request_list->count == 0) {
event_add_event(master, loading_done, on, 0, NULL); event_add_event(master, loading_done, on, 0,
&on->event_loading_done);
return; return;
} }

View File

@ -173,6 +173,7 @@ void ospf6_neighbor_delete(struct ospf6_neighbor *on)
EVENT_OFF(on->thread_send_lsack); EVENT_OFF(on->thread_send_lsack);
EVENT_OFF(on->thread_exchange_done); EVENT_OFF(on->thread_exchange_done);
EVENT_OFF(on->thread_adj_ok); EVENT_OFF(on->thread_adj_ok);
EVENT_OFF(on->event_loading_done);
EVENT_OFF(on->gr_helper_info.t_grace_timer); EVENT_OFF(on->gr_helper_info.t_grace_timer);
@ -428,7 +429,8 @@ void ospf6_check_nbr_loading(struct ospf6_neighbor *on)
if ((on->state == OSPF6_NEIGHBOR_LOADING) if ((on->state == OSPF6_NEIGHBOR_LOADING)
|| (on->state == OSPF6_NEIGHBOR_EXCHANGE)) { || (on->state == OSPF6_NEIGHBOR_EXCHANGE)) {
if (on->request_list->count == 0) if (on->request_list->count == 0)
event_add_event(master, loading_done, on, 0, NULL); event_add_event(master, loading_done, on, 0,
&on->event_loading_done);
else if (on->last_ls_req == NULL) { else if (on->last_ls_req == NULL) {
EVENT_OFF(on->thread_send_lsreq); EVENT_OFF(on->thread_send_lsreq);
event_add_event(master, ospf6_lsreq_send, on, 0, event_add_event(master, ospf6_lsreq_send, on, 0,

View File

@ -123,6 +123,7 @@ struct ospf6_neighbor {
struct event *thread_send_lsack; struct event *thread_send_lsack;
struct event *thread_exchange_done; struct event *thread_exchange_done;
struct event *thread_adj_ok; struct event *thread_adj_ok;
struct event *event_loading_done;
/* BFD information */ /* BFD information */
struct bfd_session_params *bfd_session; struct bfd_session_params *bfd_session;