1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

Kernel: Generalize the UpdateArp table to UpdateTable

We can use the same enum cases to apply to updates on different
networking tables within the Kernel (i.e. a routing table)
This commit is contained in:
brapru 2022-03-12 13:56:23 -05:00 committed by Brian Gianforcaro
parent 03d38e3ab8
commit 0718b20df0
4 changed files with 9 additions and 9 deletions

View file

@ -110,12 +110,12 @@ SpinlockProtected<HashMap<IPv4Address, MACAddress>>& arp_table()
return *s_arp_table;
}
void update_arp_table(IPv4Address const& ip_addr, MACAddress const& addr, UpdateArp update)
void update_arp_table(IPv4Address const& ip_addr, MACAddress const& addr, UpdateTable update)
{
arp_table().with([&](auto& table) {
if (update == UpdateArp::Set)
if (update == UpdateTable::Set)
table.set(ip_addr, addr);
if (update == UpdateArp::Delete)
if (update == UpdateTable::Delete)
table.remove(ip_addr);
});
s_arp_table_blocker_set->unblock_blockers_waiting_for_ipv4_address(ip_addr, addr);