From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTEwU-0000Ey-BK for qemu-devel@nongnu.org; Tue, 09 Feb 2016 15:31:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTEwR-00057g-5f for qemu-devel@nongnu.org; Tue, 09 Feb 2016 15:31:22 -0500 Received: from domu-toccata.ens-lyon.fr ([140.77.166.138]:35897 helo=sonata.ens-lyon.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTEwQ-00057Q-UZ for qemu-devel@nongnu.org; Tue, 09 Feb 2016 15:31:19 -0500 Date: Tue, 9 Feb 2016 21:31:15 +0100 From: Samuel Thibault Message-ID: <20160209203115.GG2673@var.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BA1462.2050704@redhat.com> <56BA1057.6030409@redhat.com> Subject: Re: [Qemu-devel] [PATCHv7 1/9] slirp: Adding IPv6, ICMPv6 Echo and NDP autoconfiguration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , Eric Blake Cc: zhanghailiang , Li Zhijian , Stefan Hajnoczi , Jason Wang , Dave Gilbert , Vasiliy Tolstov , qemu-devel@nongnu.org, Gonglei , Jan Kiszka , Huangpeng , Yang Hongyang , Guillaume Subiron Thomas Huth, on Tue 09 Feb 2016 17:14:15 +0100, wrote: > > + srand(time(NULL)); > > That srand should maybe be done in main() instead? (Otherwise every > subsystem might end up in repeating this all over the place) Eric Blake added: > >> +#define rand_a_b(a, b)\ > >> + (rand()%(int)(b-a)+a) > > Should we rely on glib for nicer random interval functions? Why not indeed. What do you prefer? A global GRand (as suggested above), or a GRand local to the Slirp? Samuel