diff options
author | rpokala <rpokala@FreeBSD.org> | 2017-05-17 22:29:25 +0000 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2017-05-18 07:48:53 -0300 |
commit | d97064d770b5fe7f4ea2dc4cd031e829b1a1a0e3 (patch) | |
tree | 249be7e31228212b398dcfd17f236ef0ba600eaa /sys/net/if_var.h | |
parent | bbfdb9a1d32f8fbc853e0422c9916f660f048893 (diff) | |
download | FreeBSD-src-d97064d770b5fe7f4ea2dc4cd031e829b1a1a0e3.zip FreeBSD-src-d97064d770b5fe7f4ea2dc4cd031e829b1a1a0e3.tar.gz |
MFC r318160, 318176: Persistently store NIC's hardware MAC address, and add
a way to retrive it
NOTE: Due to restructuring, the merges didn't apply cleanly; the resulting
change is almost identical to what went into stable/11, but in some cases in
different locations.
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
(cherry picked from commit 2ce46e31d62424593e08c3853efe8c1e9283aba2)
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r-- | sys/net/if_var.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 1ff7a4b..57d7028 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -200,6 +200,7 @@ struct ifnet { (struct ifnet *, struct vnet *, char *); struct vnet *if_home_vnet; /* where this ifnet originates from */ struct ifaddr *if_addr; /* pointer to link-level address */ + void *if_hw_addr; /* hardware link-level address */ void *if_llsoftc; /* link layer softc */ int if_drv_flags; /* driver-managed status flags */ struct ifaltq if_snd; /* output queue (includes altq) */ @@ -968,6 +969,7 @@ void if_qflush(struct ifnet *); void if_ref(struct ifnet *); void if_rele(struct ifnet *); int if_setlladdr(struct ifnet *, const u_char *, int); +int if_gethwaddr(struct ifnet *, struct ifreq *); void if_up(struct ifnet *); int ifioctl(struct socket *, u_long, caddr_t, struct thread *); int ifpromisc(struct ifnet *, int); |