summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrpokala <rpokala@FreeBSD.org>2017-05-18 23:41:18 +0000
committerRenato Botelho <renato@netgate.com>2017-05-19 07:21:08 -0300
commit660a69d1183a8622c737884a7de58e984462723f (patch)
tree0e9730e58630d0cbee00155dc6388ee8a2ce5c21
parent51c8a24f312aa3a6886317435f2c75dfad37f4c2 (diff)
downloadFreeBSD-src-660a69d1183a8622c737884a7de58e984462723f.zip
FreeBSD-src-660a69d1183a8622c737884a7de58e984462723f.tar.gz
Persistently store NIC's hardware MAC address, and add a way to retrive it
jhb pointed out that (struct ifnet) is part of the network driver KBI, and thus the offsets of internal fields must not change. Therefore, move the new "if_hw_addr" field to the end, and consume one of the "if_pspare"s; that's what they're there for. The new field replaces the *last* element of that array; that way, offsetof(if_pspare) and offsetof(if_ispare) are unchanged compared to before r318397. PR: 194386 Reviewed by: jhb Pointyhat to: rpokala Sponsored by: Panasas (cherry picked from commit 53168a58b2d5e27ea918b00e0398e6629c91864c)
-rw-r--r--sys/net/if_var.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 3eba221..569465b 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -241,7 +241,6 @@ struct ifnet {
struct ifmultihead if_multiaddrs; /* multicast addresses configured */
int if_amcount; /* number of all-multicast requests */
struct ifaddr *if_addr; /* pointer to link-level address */
- void *if_hw_addr; /* hardware link-level address */
const u_int8_t *if_broadcastaddr; /* linklevel broadcast bytestring */
struct rwlock if_afdata_lock;
void *if_afdata[AF_MAX];
@@ -312,7 +311,8 @@ struct ifnet {
* that structure can be enhanced without changing the kernel
* binary interface.
*/
- void *if_pspare[4]; /* packet pacing / general use */
+ void *if_pspare[3]; /* packet pacing / general use */
+ void *if_hw_addr; /* hardware link-level address */
int if_ispare[4]; /* packet pacing / general use */
};
OpenPOWER on IntegriCloud