mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 03:06:39 +00:00
nic_router: fix link state on dhcp server reconfig
When reconfiguring the NIC router modifies the information that DHCP clients received through a DHCP server of the NIC router, the link state of the correspodning interface has to do a "down-up" sequence. This provides a signal to the DHCP clients to redo DHCP, receive the new information and update accordingly. Fixes #3931
This commit is contained in:
parent
b0327d0544
commit
8d8edaea5d
@ -1861,6 +1861,7 @@ void Interface::_update_icmp_links(Domain &cln_dom)
|
|||||||
void Interface::_update_dhcp_allocations(Domain &old_domain,
|
void Interface::_update_dhcp_allocations(Domain &old_domain,
|
||||||
Domain &new_domain)
|
Domain &new_domain)
|
||||||
{
|
{
|
||||||
|
bool dhcp_clients_outdated { false };
|
||||||
try {
|
try {
|
||||||
Dhcp_server &old_dhcp_srv = old_domain.dhcp_server();
|
Dhcp_server &old_dhcp_srv = old_domain.dhcp_server();
|
||||||
Dhcp_server &new_dhcp_srv = new_domain.dhcp_server();
|
Dhcp_server &new_dhcp_srv = new_domain.dhcp_server();
|
||||||
@ -1890,6 +1891,7 @@ void Interface::_update_dhcp_allocations(Domain &old_domain,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* dismiss DHCP allocation */
|
/* dismiss DHCP allocation */
|
||||||
|
dhcp_clients_outdated = true;
|
||||||
_dhcp_allocations.remove(allocation);
|
_dhcp_allocations.remove(allocation);
|
||||||
_destroy_dhcp_allocation(allocation, old_domain);
|
_destroy_dhcp_allocation(allocation, old_domain);
|
||||||
});
|
});
|
||||||
@ -1897,6 +1899,7 @@ void Interface::_update_dhcp_allocations(Domain &old_domain,
|
|||||||
catch (Pointer<Dhcp_server>::Invalid) {
|
catch (Pointer<Dhcp_server>::Invalid) {
|
||||||
|
|
||||||
/* dismiss all DHCP allocations */
|
/* dismiss all DHCP allocations */
|
||||||
|
dhcp_clients_outdated = true;
|
||||||
while (Dhcp_allocation *allocation = _dhcp_allocations.first()) {
|
while (Dhcp_allocation *allocation = _dhcp_allocations.first()) {
|
||||||
if (_config().verbose()) {
|
if (_config().verbose()) {
|
||||||
log("[", new_domain, "] dismiss DHCP allocation: ",
|
log("[", new_domain, "] dismiss DHCP allocation: ",
|
||||||
@ -1906,6 +1909,10 @@ void Interface::_update_dhcp_allocations(Domain &old_domain,
|
|||||||
_destroy_dhcp_allocation(*allocation, old_domain);
|
_destroy_dhcp_allocation(*allocation, old_domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dhcp_clients_outdated) {
|
||||||
|
_policy.interface_unready();
|
||||||
|
_policy.interface_ready();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user