network/neighbor: also remove neighbor on cancelling request

Otherwise, the neighbor may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.
This commit is contained in:
Yu Watanabe
2024-01-05 19:17:59 +09:00
parent 4303e9806b
commit c902fa08c3
3 changed files with 17 additions and 14 deletions
+7
View File
@@ -954,6 +954,13 @@ static int link_drop_requests(Link *link) {
RET_GATHER(ret, address_remove(address, link));
break;
}
case REQUEST_TYPE_NEIGHBOR: {
Neighbor *neighbor = ASSERT_PTR(req->userdata);
if (neighbor_get(link, neighbor, NULL) < 0)
RET_GATHER(ret, neighbor_remove(neighbor, link));
break;
}
default:
;
}