1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-30 10:22: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

@ -653,7 +653,7 @@ ErrorOr<void> IPv4Socket::ioctl(OpenFileDescription&, unsigned request, Userspac
return EPERM;
if (arp_req.arp_pa.sa_family != AF_INET)
return EAFNOSUPPORT;
update_arp_table(IPv4Address(((sockaddr_in&)arp_req.arp_pa).sin_addr.s_addr), *(MACAddress*)&arp_req.arp_ha.sa_data[0], UpdateArp::Set);
update_arp_table(IPv4Address(((sockaddr_in&)arp_req.arp_pa).sin_addr.s_addr), *(MACAddress*)&arp_req.arp_ha.sa_data[0], UpdateTable::Set);
return {};
case SIOCDARP:
@ -661,7 +661,7 @@ ErrorOr<void> IPv4Socket::ioctl(OpenFileDescription&, unsigned request, Userspac
return EPERM;
if (arp_req.arp_pa.sa_family != AF_INET)
return EAFNOSUPPORT;
update_arp_table(IPv4Address(((sockaddr_in&)arp_req.arp_pa).sin_addr.s_addr), *(MACAddress*)&arp_req.arp_ha.sa_data[0], UpdateArp::Delete);
update_arp_table(IPv4Address(((sockaddr_in&)arp_req.arp_pa).sin_addr.s_addr), *(MACAddress*)&arp_req.arp_ha.sa_data[0], UpdateTable::Delete);
return {};
}