Le 30/08/2011 22:10, elison.ni...@gmail.com a écrit : > On Wed, Aug 31, 2011 at 1:25 AM, Wolfgang Denk<w...@denx.de> wrote: > >> Dear "elison.ni...@gmail.com", >> >> In message<CAAO= >> tyeytt4m+54y_qovck7vdqy_ssoktrdjbpf8+pq0-yc...@mail.gmail.com> you wrote: >>> >>> I am trying to random my mac in u-boot on AT91RM9200 and AT91SAM9G45 >>> processor. >> >> This approach is inherently wrong, and I'm actually happy if you >> find it difficult to implement. Otherwise we would probably have >> rejected your code when you submit the patches. >> >> MAC addresses are supposed to be NOT random. Please see the related >> FAQ, for example >> http://www.denx.de/wiki/view/DULG/WhereCanIGetAValidMACAddress >> >> Hi, > I do realize that. The "random" MAC address is not forever. It is only to > get the "actual" MAC in the first boot so as to not set the environment > variables manually.
If it is only until the environment provides the MAC, then I suspect the "random MAC" will never ever be used in a single packet, right? But then, what's the point of setting it if it won't be used at all? Simply set the real MAC once you have it. (from your other reply) > Why does arch/blackfin/include/asm/net.h have bfin_gen_rand_mac ? Just because some code in U-Boot appears to wrongly use random MACs does not *make* it wrong, and does not make the use you intend right either.. :) In the Blackfin case, just as in the the Marvell GBE driver case, a random MAC is generated only if the actual MAC is *not* in the environment -- a case that should not happen in normal cicumstances. The blackfin use case is "if the environment does not contain a MAC, then as a degenerate case we provide a private (random) MAC so that the U-Boot can still use the network" -- a resilience case for a degenerate situation. This differs from your use case which apparently is "use a random MAC so that with some yet-undefined mechanism we can ask for a real MAC because we don't want to set the real MAC in the environment" -- to me it looks not like a degenerate case but a nominal use case. Now I may have misunderstood your case, of course. Feel free to provide more context. Amicalement, -- Albert. _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot