mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 06:32:54 +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
Notes:
sideshowbarker
2024-07-18 08:21:34 +09:00
Author: https://github.com/brapru
Commit: f8c104aaaf
Pull-request: https://github.com/SerenityOS/serenity/pull/8996
3 changed files with 13 additions and 5 deletions
Kernel/Net
|
@ -151,7 +151,7 @@ void handle_arp(const EthernetFrameHeader& eth, size_t frame_size)
|
|||
// Someone has this IPv4 address. I guess we can try to remember that.
|
||||
// FIXME: Protect against ARP spamming.
|
||||
// FIXME: Support static ARP table entries.
|
||||
update_arp_table(packet.sender_protocol_address(), packet.sender_hardware_address());
|
||||
update_arp_table(packet.sender_protocol_address(), packet.sender_hardware_address(), UpdateArp::Set);
|
||||
}
|
||||
|
||||
if (packet.operation() == ARPOperation::Request) {
|
||||
|
@ -199,7 +199,7 @@ void handle_ipv4(const EthernetFrameHeader& eth, size_t frame_size, const Time&
|
|||
auto my_net = adapter.ipv4_address().to_u32() & adapter.ipv4_netmask().to_u32();
|
||||
auto their_net = packet.source().to_u32() & adapter.ipv4_netmask().to_u32();
|
||||
if (my_net == their_net)
|
||||
update_arp_table(packet.source(), eth.source());
|
||||
update_arp_table(packet.source(), eth.source(), UpdateArp::Set);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue