From 055862c0ebc4288228e895cc90323ccda0247c9c Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Fri, 15 Jun 2018 13:08:47 +0200 Subject: [PATCH] nic_router: cancel remote ARP on new IP config When a domain is updated to a new component config, the two criteria for keeping an ARP waiting state of a remote domain are whether the remote domain still exists and whether its IP config is still the same. This means that a domain must also dissolve all of its remote ARP waiting states if its IP config changes (without an update of the component config). This wasn't the case until now. Issue #2840 --- repos/os/src/server/nic_router/domain.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/repos/os/src/server/nic_router/domain.cc b/repos/os/src/server/nic_router/domain.cc index bd48c0fc12..685da77aa0 100644 --- a/repos/os/src/server/nic_router/domain.cc +++ b/repos/os/src/server/nic_router/domain.cc @@ -80,6 +80,11 @@ void Domain::ip_config(Ipv4_config const &new_ip_config) interface.detach_from_remote_ip_config(); }); }); + /* dissolve foreign ARP waiters */ + while (_foreign_arp_waiters.first()) { + Arp_waiter &waiter = *_foreign_arp_waiters.first()->object(); + waiter.src().cancel_arp_waiting(waiter); + } } /* overwrite old with new IP config */ _ip_config.construct(new_ip_config); @@ -229,16 +234,6 @@ Domain::~Domain() } -void Domain::__FIXME__dissolve_foreign_arp_waiters() -{ - /* let other interfaces destroy their ARP waiters that wait for us */ - while (_foreign_arp_waiters.first()) { - Arp_waiter &waiter = *_foreign_arp_waiters.first()->object(); - waiter.src().cancel_arp_waiting(waiter); - } -} - - Dhcp_server &Domain::dhcp_server() { Dhcp_server &dhcp_server = _dhcp_server();