From 2ff8b729046a2184760861e257c713eb6f329fa2 Mon Sep 17 00:00:00 2001 From: rpokala Date: Wed, 17 May 2017 05:53:25 +0000 Subject: MFC r318160, 318176: Persistently store NIC's hardware MAC address, and add a way to retrive it The MAC address reported by `ifconfig ${nic} ether' does not always match the address in the hardware, as reported by the driver during attach. In particular, NICs which are components of a lagg(4) interface all report the same MAC. When attaching, the NIC driver passes the MAC address it read from the hardware as an argument to ether_ifattach(). Keep a second copy of it, and create ioctl(SIOCGHWADDR) to return it. Teach `ifconfig' to report it along with the active MAC address. PR: 194386 --- sys/sys/sockio.h | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/sys') diff --git a/sys/sys/sockio.h b/sys/sys/sockio.h index abdf1c3..de79041 100644 --- a/sys/sys/sockio.h +++ b/sys/sys/sockio.h @@ -97,6 +97,7 @@ #define SIOCGIFSTATUS _IOWR('i', 59, struct ifstat) /* get IF status */ #define SIOCSIFLLADDR _IOW('i', 60, struct ifreq) /* set linklevel addr */ #define SIOCGI2C _IOWR('i', 61, struct ifreq) /* get I2C data */ +#define SIOCGHWADDR _IOWR('i', 62, struct ifreq) /* get hardware lladdr */ #define SIOCSIFPHYADDR _IOW('i', 70, struct ifaliasreq) /* set gif address */ #define SIOCGIFPSRCADDR _IOWR('i', 71, struct ifreq) /* get gif psrc addr */ -- cgit v1.1