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

Kernel: Define and return the ARPHRD_* device type in SIOCGIFHWADDR

The sa_family field in SIOCGIFHWADDR specifies the underlying network
interface's device type, this is hardcoded to generic "Ethernet" right
now, as we don't have a nice way to query it.
This commit is contained in:
Idan Horowitz 2021-12-05 01:36:04 +02:00 committed by Brian Gianforcaro
parent 3080cc16ec
commit 3a1ff175e8
2 changed files with 9 additions and 1 deletions

View file

@ -712,7 +712,7 @@ ErrorOr<void> IPv4Socket::ioctl(OpenFileDescription&, unsigned request, Userspac
case SIOCGIFHWADDR: {
auto mac_address = adapter->mac_address();
ifr.ifr_hwaddr.sa_family = AF_INET;
ifr.ifr_hwaddr.sa_family = ARPHRD_ETHER; // FIXME: Query the underlying network interface for it's type
mac_address.copy_to(Bytes { ifr.ifr_hwaddr.sa_data, sizeof(ifr.ifr_hwaddr.sa_data) });
return copy_to_user(user_ifr, &ifr);
}