Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:07:11 -0000
From:      Ian Lepore <ian@freebsd.org>
To:        John Baldwin <jhb@FreeBSD.org>, Ganbold Tsagaankhuu <ganbold@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r346052 - head/sys/dev/usb/net
Message-ID:  <969703ae8558b4b6f2930208e9c36927b546bb77.camel@freebsd.org>
In-Reply-To: <33d96fdb-0218-6555-6f03-3105649a1904@FreeBSD.org>
References:  <201904091354.x39Ds9e6070857@repo.freebsd.org> <ea3cb1dd-585b-e60f-294a-743645492d69@FreeBSD.org> <bd56e7a51ccc99aca6300ddafa449e6de95a1e20.camel@freebsd.org> <33d96fdb-0218-6555-6f03-3105649a1904@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2019-04-09 at 09:33 -0700, John Baldwin wrote:
> On 4/9/19 9:17 AM, Ian Lepore wrote:
> > On Tue, 2019-04-09 at 09:11 -0700, John Baldwin wrote:
> > > On 4/9/19 6:54 AM, Ganbold Tsagaankhuu wrote:
> > > > Author: ganbold
> > > > Date: Tue Apr  9 13:54:08 2019
> > > > New Revision: 346052
> > > > URL: https://svnweb.freebsd.org/changeset/base/346052
> > > > 
> > > > Log:
> > > >   In some cases like NanoPI R1, its second USB ethernet
> > > >   RTL8152 (chip version URE_CHIP_VER_4C10) doesn't
> > > >   have hardwired MAC address, in other words, it is all zeros.
> > > >   This commit fixes it by setting random MAC address
> > > >   when MAC address is all zeros.
> > > >   
> > > >   Reviewed by:	kevlo
> > > >   Differential Revision:	
> > > > https://reviews.freebsd.org/D19856
> > > 
> > > It would be best to not use a purely random mac address and to
> > > use
> > > the
> > > function kevans@ added recently.  That function generates a MAC
> > > address
> > > from the FreeBSD OUI using a cryptographic hash so you get a
> > > stable address across boots on a given host.
> > > 
> > 
> > How could that possibly work?  If it's not random, you can't have
> > two
> > such devices on the same network.  If it is random, it's not stable
> > from one boot to the next.
> 
> It uses the UUID and interface name as input into the hash.  

> The UUID is per-host.

Oh, so it only works on x86 (or I guess any system that has something
like a bios that can provide you with a uuid that doesn't change from
one boot to the next).

-- Ian

>   In this particular use case, the first USB device will
> have a varying MAC address which is an input into the UUID.  Though,
> the other option this driver could use for this specific case would
> be
> to just take the first MAC address and +1 to get the second one.
> 








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