[U-Boot] How to random my mac in u-boot

Wolfgang Denk wd at denx.de
Mon Feb 8 08:58:55 CET 2010


Dear Peter Pan,

In message <48abf2c21002072147t7e67ba44i4298b39acc5d7380 at mail.gmail.com> you wrote:
> Recently, we had a issue that we need to start more than one board at
> a time. The problem
> we are facing is that every board is using the same u-boot, which
> makes them all have the
> same mac address.

This means that you have a serious configuration problem in ypur
U-Boot port: the U-Boot binary should never contain any MAN accress at
all. I recommend to fix this now.

> Firstly, I think I can gives out a random MAC as we need, but I can
> not find any rand() or srand()
> function in U-Boot.

Instead of doing random things you should read the FAQ, especially
here:

http://www.denx.de/wiki/view/DULG/WhereCanIGetAValidMACAddress

> Is there a chance that I can do this random job when U-Boot starts?

You are not supposed to  do  that.  For  testing,  you  can  use  the
gen_eth_addr  program  in  the  tools/ directory to generate "locally
administered"  MAC  addresses,  but  these  are  NOT   suitable   for
productions boards.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Objects in mirror are closer than they appear.


More information about the U-Boot mailing list