Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Jan 2020 20:12:15 +0000 (UTC)
From:      Kirill Ponomarev <krion@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356801 - head/sys/netgraph
Message-ID:  <202001162012.00GKCFWK092527@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: krion (ports committer)
Date: Thu Jan 16 20:12:15 2020
New Revision: 356801
URL: https://svnweb.freebsd.org/changeset/base/356801

Log:
  Generate MAC address from the FreeBSD OUI range.
  
  Submitted by:	aleksandr.fedorov_vstack_com
  Approved by:	kevans
  Differential Revision:	https://reviews.freebsd.org/D23168

Modified:
  head/sys/netgraph/ng_eiface.c

Modified: head/sys/netgraph/ng_eiface.c
==============================================================================
--- head/sys/netgraph/ng_eiface.c	Thu Jan 16 20:02:41 2020	(r356800)
+++ head/sys/netgraph/ng_eiface.c	Thu Jan 16 20:12:15 2020	(r356801)
@@ -385,7 +385,7 @@ ng_eiface_constructor(node_p node)
 {
 	struct ifnet *ifp;
 	priv_p priv;
-	u_char eaddr[6] = {0,0,0,0,0,0};
+	struct ether_addr eaddr;
 
 	/* Allocate node and interface private structures */
 	priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK | M_ZERO);
@@ -435,7 +435,8 @@ ng_eiface_constructor(node_p node)
 		    ifp->if_xname);
 
 	/* Attach the interface */
-	ether_ifattach(ifp, eaddr);
+	ether_gen_addr(ifp, &eaddr);
+	ether_ifattach(ifp, eaddr.octet);
 	ifp->if_baudrate = ifmedia_baudrate(IFM_ETHER | IFM_1000_T);
 
 	/* Done */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001162012.00GKCFWK092527>