Date: Thu, 18 May 2017 23:41:18 +0000 (UTC) From: Ravi Pokala <rpokala@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r318504 - stable/11/sys/net Message-ID: <201705182341.v4INfIaf091476@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpokala Date: Thu May 18 23:41:18 2017 New Revision: 318504 URL: https://svnweb.freebsd.org/changeset/base/318504 Log: 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 Modified: stable/11/sys/net/if_var.h Modified: stable/11/sys/net/if_var.h ============================================================================== --- stable/11/sys/net/if_var.h Thu May 18 22:50:16 2017 (r318503) +++ stable/11/sys/net/if_var.h Thu May 18 23:41:18 2017 (r318504) @@ -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 */ };
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705182341.v4INfIaf091476>