From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 6 18:07:18 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BAE5D558; Thu, 6 Mar 2014 18:07:18 +0000 (UTC) Received: from sender1.zohomail.com (sender1.zohomail.com [72.5.230.95]) by mx1.freebsd.org (Postfix) with ESMTP id 9C7D169B; Thu, 6 Mar 2014 18:07:18 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version; b=HM/BBNbTdSenXiDT2ynfmwNHykJbDyLwP+GGeDberQtXLsaFu3+m5VRGng/f7XWdgjpFunQxLmmv L26HBA0iKCSWoc1yZXcq2CXVgzeNsBmhYHEB5ZueAUPnlGVO0IFT Received: from [10.1.2.6] (46.229.54.117 [46.229.54.117]) by mx.zohomail.com with SMTPS id 1394129234804195.66643939715425; Thu, 6 Mar 2014 10:07:14 -0800 (PST) Subject: Re: Reading burned-in NIC MAC address from the user space. From: clutton To: Warner Losh In-Reply-To: <10C93415-7C49-459E-921E-EE358C3B886C@bsdimp.com> References: <1394115222.8935.17.camel@eva02> <10C93415-7C49-459E-921E-EE358C3B886C@bsdimp.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-d/hRPNuZ1dX+d7bd1WqS" Date: Thu, 06 Mar 2014 20:07:07 +0200 Message-ID: <1394129227.732.37.camel@eva02> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port X-Zoho-Virus-Status: 1 X-ZohoMail: Ss SS_10 UW UB UW UB SF_TD_EXT SGR3_1_19024_340 X-ZohoMail-Owner: <1394129227.732.37.camel@eva02>+zmo_0_ X-ZohoMail-Sender: 46.229.54.117 X-Mailman-Approved-At: Thu, 06 Mar 2014 18:16:30 +0000 Cc: FreeBSD Hackers , freebsd-drivers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Mar 2014 18:07:18 -0000 --=-d/hRPNuZ1dX+d7bd1WqS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2014-03-06 at 08:35 -0700, Warner Losh wrote: > On Mar 6, 2014, at 7:13 AM, clutton wrote: >=20 > > Hi lists. > >=20 > > I'm porting a GNU macchanger to the FreeBSD. Everything has almost done= , > > except restoring the mac to the original one. > >=20 > > The Linux users can exploit ioctl with SIOCETHTOOL pointing to a proper > > ifreq(ETHTOOL_GPERMADDR), I have no idea how to do this using FreeBSD, > > is it even possible? >=20 > I=E2=80=99d check the source for ifconfig. >=20 > ifconfig ep0 link 1:2:3:4:5:6 >=20 > does the trick=E2=80=A6 >=20 > Warner No, it doesn't. It does the different trick :) You misunderstood the question. I don't asked how to set the mac address. The question is how to read burned in mac address from user space. ifconfig is not capable doing such a thing. As I can see the drivers read MAC from EEPROM using different ways. Is there any interface to this low level work? WHY: The GNU macchanger has very nice option "--permanent Reset to original, permanent hardware MAC". This is only one thing I haven't ported yet. --=-d/hRPNuZ1dX+d7bd1WqS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQIcBAABAgAGBQJTGLlKAAoJECNkWbjnbjuiVd8P/34603BFhHxwebsc4U23X/50 SE/okC2F1GsXujVNmcyaoU0EbfDkIsduivuitaVx1wDQjoEnnRXUvxyZTJpe0Umh Imcw8bBueoqEBfrYJU8yr/ZoRGDCmGrXvkXOzTtx+b8JIlVex2X0A1dJrLgMa1AK W0zHw6Uv08PTMSj6JNOgcOnYkQYtvAxXvrnS9EfFsMpkJh1h9xdQCfvqsKURZ2l6 wzBYTbbfaX5ijNXnevaPBfej3AWrDbRzLOou0RprMoRwk0QlsYdMMx/V5KEIwxdo mDKAeIKLqv3VVWYlEiXOKcwF6yFKP+llz5lanMd1UJtb1aOqRV6IzD+X4546lAiq 32Ke7YpxPmnygV7bJBzS1XrtJX34QTQE8aBAAAb3ijtbGyC0TX5Vjd361pmVLwGi cR0Tnp6pxdzi4eYWfVZBN+pwaaPd6YQyqdf6PunDqLYF7SNjMQdr7vtEETi55ufs L+SpY2GLgfo6RbvR7I8WsbjrIaLTTJOrLMNnf9xykxyLgehbzoNgSFaKod0fU2ci 1GYS5Yol5r3M3KVU7fI6k2JXXaoHUX4znGfqg1HliPkdV4nFNd8hcqOxtwS5uLrY HlsvIbfuMMAXn9t639OR9LgCEoxhP0F9sFep6uJx/pGBqc1991X7xE/bkFtRXzgg RBkC0y7X41cGeXq0Ot+P =2Vq5 -----END PGP SIGNATURE----- --=-d/hRPNuZ1dX+d7bd1WqS--