mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 03:45:24 +00:00
nic_router: fix DHCP-server deinitialization
Due to a bug in the deinitialization of the DHCP server of a domain (the reference to the destroyed object was not cleared), the NIC router could end up in a page fault caused by a double-free at the heap. This also fixes the previously missing dissolving of the "DNS-server-from" relation to a remote domain. Issue #2840
This commit is contained in:
parent
fc90c5f8f0
commit
27155a507f
@ -295,7 +295,13 @@ void Domain::deinit()
|
||||
_tcp_rules.destroy_each(_alloc);
|
||||
_udp_forward_rules.destroy_each(_alloc);
|
||||
_tcp_forward_rules.destroy_each(_alloc);
|
||||
try { destroy(_alloc, &_dhcp_server()); }
|
||||
try {
|
||||
Dhcp_server &dhcp_server = _dhcp_server();
|
||||
_dhcp_server = Pointer<Dhcp_server>();
|
||||
try { dhcp_server.dns_server_from().ip_config_dependents().remove(this); }
|
||||
catch (Pointer<Domain>::Invalid) { }
|
||||
destroy(_alloc, &dhcp_server);
|
||||
}
|
||||
catch (Pointer<Dhcp_server>::Invalid) { }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user