Ensure Random.self_init() is called.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 24 Mar 2015 21:34:17 +0000 (21:34 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 24 Mar 2015 21:34:17 +0000 (21:34 +0000)
Otherwise guests get the same MAC address because there is
insufficient randomness in the OCaml PRNG.

mclu.ml

diff --git a/mclu.ml b/mclu.ml
index a6e6e1d..b4bbf94 100644 (file)
--- a/mclu.ml
+++ b/mclu.ml
@@ -20,6 +20,8 @@ open Utils
 
 open Printf
 
+let () = Random.self_init ()
+
 let config_file =
   let default =
     try Sys.getenv "MCLU_CONFIG"