All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
To: Ian Pratt <Ian.Pratt@eu.citrix.com>
Cc: Xen Devel <xen-devel@lists.xensource.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"Gianni Tedesco (3P)" <gianni.tedesco@citrix.com>,
	Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: [PATCH]: xl: use libuuid to generate random UUID's
Date: Thu, 5 Aug 2010 10:19:18 +0100	[thread overview]
Message-ID: <4C5A8216.6030607@eu.citrix.com> (raw)
In-Reply-To: <4FA716B1526C7C4DB0375C6DADBC4EA37AD0596B2F@LONPMAILBOX01.citrite.net>

On 05/08/10 03:19, Ian Pratt wrote:
>> Link to libuuid in xl et al and bring in the header file. Use libuuid to
>> generate UUID's which are actually UU and not merely pseudo-random :)
>>
>> As a side-effect I have also used libuuid to generate more random MAC
>> addresses rather than keeping the old code and simply xoring getpid() in
>> to the PRNG seed.
>
> The MAC generation scheme in xend was awful -- it might be a good idea to take this opportunity to fix things in libxl.
>
> The best approach is to generate locally administered MAC addresses hence giving us 46 bits of freedom rather than XenSource registered OUI addresses which have just 24 bits -- collisions will be *much* less likely. Further, it's best not to generate random addresses every time, but to derive the MAC address from a good hash of the VM UUID and the NIC number so that they are deterministic.

Adding some details here...

In general it would be a good idea to recopy already *existing* schemes 
(unless it can be proven to be the wrong thing to do) already available 
in XCP and XCI into libxl, instead of reinventing new square wheels like 
here. (although this square wheel is in xl not in libxl actually)

The MAC generation, as the one Ian mentioned, is already available in 
the XCI toolstack and in the XCP toolstack (the code there is a bit more 
scattered so i'ld recommend reading the XCI one).

-- 
Vincent

  parent reply	other threads:[~2010-08-05  9:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 17:49 [PATCH]: xl: use libuuid to generate random UUID's Gianni Tedesco
2010-08-05  2:19 ` Ian Pratt
2010-08-05  2:27   ` Jeremy Fitzhardinge
2010-08-10 10:44     ` Ian Campbell
2010-08-10 11:14       ` Vincent Hanquez
2010-08-10 14:38         ` Stefano Stabellini
2010-08-10 19:38       ` Jeremy Fitzhardinge
2010-08-05  9:19   ` Vincent Hanquez [this message]
2010-08-05 10:13     ` Christoph Egger
2010-08-05 11:11       ` Vincent Hanquez
2010-08-05 16:42         ` Stefano Stabellini
2010-08-05 10:34     ` Stefano Stabellini
2010-08-09 10:51   ` Ian Jackson
2010-08-09 11:04     ` Gianni Tedesco
2010-08-10 15:23       ` Ian Jackson
2010-08-10 15:24         ` Gianni Tedesco
2010-08-10 16:55           ` Ian Jackson
2010-08-10 16:06         ` Ian Pratt
2010-08-10 19:43         ` Jeremy Fitzhardinge
2010-08-11 11:15           ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C5A8216.6030607@eu.citrix.com \
    --to=vincent.hanquez@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Ian.Pratt@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=gianni.tedesco@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.