mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +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:
parent
03d38e3ab8
commit
0718b20df0
Notes:
sideshowbarker
2024-07-17 11:29:54 +09:00
Author: https://github.com/brapru
Commit: 0718b20df0
Pull-request: https://github.com/SerenityOS/serenity/pull/13068
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/bgianfo
Reviewed-by: https://github.com/gmta ✅
4 changed files with 9 additions and 9 deletions
|
@ -158,7 +158,7 @@ void handle_arp(EthernetFrameHeader const& eth, size_t frame_size)
|
|||
if (!packet.sender_hardware_address().is_zero() && !packet.sender_protocol_address().is_zero()) {
|
||||
// Someone has this IPv4 address. I guess we can try to remember that.
|
||||
// FIXME: Protect against ARP spamming.
|
||||
update_arp_table(packet.sender_protocol_address(), packet.sender_hardware_address(), UpdateArp::Set);
|
||||
update_arp_table(packet.sender_protocol_address(), packet.sender_hardware_address(), UpdateTable::Set);
|
||||
}
|
||||
|
||||
if (packet.operation() == ARPOperation::Request) {
|
||||
|
@ -206,7 +206,7 @@ void handle_ipv4(EthernetFrameHeader const& eth, size_t frame_size, Time const&
|
|||
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(), UpdateArp::Set);
|
||||
update_arp_table(packet.source(), eth.source(), UpdateTable::Set);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue