Date: Thu, 18 May 2017 23:41:34 +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-10@freebsd.org Subject: svn commit: r318505 - stable/10/sys/net Message-ID: <201705182341.v4INfYTM091540@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpokala Date: Thu May 18 23:41:34 2017 New Revision: 318505 URL: https://svnweb.freebsd.org/changeset/base/318505 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. Because netmap on stable/10 uses "if_pspare[0]", the new field replaces the *last* element of that array; that way, offsetof(if_pspare) is unchanged compared to before r318430. PR: 194386 Reviewed by: jhb Pointyhat to: rpokala Sponsored by: Panasas Modified: stable/10/sys/net/if_var.h Modified: stable/10/sys/net/if_var.h ============================================================================== --- stable/10/sys/net/if_var.h Thu May 18 23:41:18 2017 (r318504) +++ stable/10/sys/net/if_var.h Thu May 18 23:41:34 2017 (r318505) @@ -200,7 +200,6 @@ 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) */ @@ -260,7 +259,8 @@ struct ifnet { */ u_int if_hw_tsomaxsegcount; /* TSO maximum segment count */ u_int if_hw_tsomaxsegsize; /* TSO maximum segment size in bytes */ - void *if_pspare[8]; /* 1 netmap, 7 TDB */ + void *if_pspare[7]; /* 1 netmap, 6 TDB */ + void *if_hw_addr; /* hardware link-level address */ }; typedef void if_init_f_t(void *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705182341.v4INfYTM091540>