From owner-svn-src-all@freebsd.org Thu May 18 23:41:19 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD421D739A4; Thu, 18 May 2017 23:41:19 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89E841307; Thu, 18 May 2017 23:41:19 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4INfIsV091477; Thu, 18 May 2017 23:41:18 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4INfIaf091476; Thu, 18 May 2017 23:41:18 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201705182341.v4INfIaf091476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Thu, 18 May 2017 23:41:18 +0000 (UTC) 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 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 23:41:19 -0000 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 */ };