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

Kernel: More work on Ethernet support.

This commit is contained in:
Andreas Kling 2019-03-10 23:40:09 +01:00
parent 97664fad60
commit 1678ac69ef
8 changed files with 62 additions and 9 deletions

View file

@ -1922,6 +1922,16 @@ int Process::sys$setpgid(pid_t specified_pid, pid_t specified_pgid)
int Process::sys$ioctl(int fd, unsigned request, unsigned arg)
{
if (auto* e1000 = E1000NetworkAdapter::the()) {
ARPPacket arp;
arp.hardware_type = 1; // Ethernet
arp.hardware_address_length = 6; // MAC length
arp.protocol_type = 0x0800; // IPv4
arp.protocol_address_length = 4; // IP length
arp.operation = 1; // 1 (request)
e1000->send(MACAddress(), arp);
}
auto* descriptor = file_descriptor(fd);
if (!descriptor)
return -EBADF;