svn commit: r318176 - head/sys/net

Ravi Pokala rpokala at FreeBSD.org
Thu May 11 06:46:40 UTC 2017


Author: rpokala
Date: Thu May 11 06:46:39 2017
New Revision: 318176
URL: https://svnweb.freebsd.org/changeset/base/318176

Log:
  Persistently store NIC's hardware MAC address, and add a way to retrive it
  
  An earlier version of r318160 allocated if_hw_addr unconditionally; when it
  became conditional, I forgot to check for NULL in ether_ifattach().
  
  Reviewed by:	kp
  MFC after:	1 week
  MFC with:	r318160
  Sponsored by:	Panasas
  Differential Revision:	https://reviews.freebsd.org/D10678
  Pointy-hat to:	rpokala

Modified:
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Thu May 11 06:35:23 2017	(r318175)
+++ head/sys/net/if_ethersubr.c	Thu May 11 06:46:39 2017	(r318176)
@@ -916,7 +916,8 @@ ether_ifattach(struct ifnet *ifp, const 
 	sdl->sdl_alen = ifp->if_addrlen;
 	bcopy(lla, LLADDR(sdl), ifp->if_addrlen);
 
-	bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
+	if (ifp->if_hw_addr != NULL)
+		bcopy(lla, ifp->if_hw_addr, ifp->if_addrlen);
 
 	bpfattach(ifp, DLT_EN10MB, ETHER_HDR_LEN);
 	if (ng_ether_attach_p != NULL)


More information about the svn-src-head mailing list