mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 19:45:07 +00:00
Kernel: Add update option to remove an entry from the ARP table
Allows for specifying whether to set/delete an entry from the table.
This commit is contained in:
parent
99b32073be
commit
f8c104aaaf
3 changed files with 13 additions and 5 deletions
|
@ -104,10 +104,13 @@ Lockable<HashMap<IPv4Address, MACAddress>>& arp_table()
|
|||
return *s_arp_table;
|
||||
}
|
||||
|
||||
void update_arp_table(const IPv4Address& ip_addr, const MACAddress& addr)
|
||||
void update_arp_table(const IPv4Address& ip_addr, const MACAddress& addr, UpdateArp update)
|
||||
{
|
||||
MutexLocker locker(arp_table().lock());
|
||||
arp_table().resource().set(ip_addr, addr);
|
||||
if (update == UpdateArp::Set)
|
||||
arp_table().resource().set(ip_addr, addr);
|
||||
if (update == UpdateArp::Delete)
|
||||
arp_table().resource().remove(ip_addr);
|
||||
s_arp_table_block_condition->unblock(ip_addr, addr);
|
||||
|
||||
if constexpr (ROUTING_DEBUG) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue