mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:17:34 +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:
parent
3080cc16ec
commit
3a1ff175e8
2 changed files with 9 additions and 1 deletions
|
@ -21,6 +21,14 @@ struct arpreq {
|
||||||
char arp_dev[16];
|
char arp_dev[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define ARPHRD_ETHER 1
|
||||||
|
#define ARPHRD_IEEE802 6
|
||||||
|
#define ARPHRD_SLIP 256
|
||||||
|
#define ARPHRD_PPP 512
|
||||||
|
#define ARPHRD_LOOPBACK 772
|
||||||
|
#define ARPHRD_FDDI 774
|
||||||
|
#define ARPHRD_IEEE802_TR 800
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -712,7 +712,7 @@ ErrorOr<void> IPv4Socket::ioctl(OpenFileDescription&, unsigned request, Userspac
|
||||||
|
|
||||||
case SIOCGIFHWADDR: {
|
case SIOCGIFHWADDR: {
|
||||||
auto mac_address = adapter->mac_address();
|
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) });
|
mac_address.copy_to(Bytes { ifr.ifr_hwaddr.sa_data, sizeof(ifr.ifr_hwaddr.sa_data) });
|
||||||
return copy_to_user(user_ifr, &ifr);
|
return copy_to_user(user_ifr, &ifr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue