From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1c9eiP-00087j-KI for mharc-grub-devel@gnu.org; Wed, 23 Nov 2016 16:04:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c9eiN-00087b-J9 for grub-devel@gnu.org; Wed, 23 Nov 2016 16:04:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c9eiM-00089n-L9 for grub-devel@gnu.org; Wed, 23 Nov 2016 16:04:23 -0500 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:35666) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c9eiM-00088x-Gh for grub-devel@gnu.org; Wed, 23 Nov 2016 16:04:22 -0500 Received: by mail-oi0-x229.google.com with SMTP id b126so29563974oia.2 for ; Wed, 23 Nov 2016 13:04:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=iT6KjQl/138x6Nq3XJ+1lCuEm6A4d/fFNmVRqPL/FuM=; b=1A73ipnn+QyO44p6b2/eKMCDRaWj3iW6ALa06wBTQg/ehQlu1JOm1CMoqbi7LXH/Ke EZnNNMA3ZEBaagQ9QqcoMVJik3Zu2fdIekWA0oJfpFeSa0W7Z3Ds7E8hHP3ncHgdfRk8 apAVzqKXfuGomz0sCKBInUcJvnv7P29KFoOxOWlHmjYdr4CQYlR9LbawckE8TqgWQ+Jy /lSH7KzUmZmaNQpl0OlcFL/KrawXCUCTRxqZvcb9fl0PUKrAADkv+HXBRwW3JlUckpI8 MsiTnSEzrYcCIoJ4Bh3forxU+Dc4+0dLMtHFR/yzhJp3T8Ayh8g4yS3YrbUUUSMC36O2 g9EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iT6KjQl/138x6Nq3XJ+1lCuEm6A4d/fFNmVRqPL/FuM=; b=gdMvuM4q1cCgRIK45QjJ0KLEsN8wPwNtUPYkZ/pth2Q5w0J41t+HD/sfbl0UPxXRBe SrUoqPEzEsol8wBd6lttVslmKcjYWQy40FsDlh4IYEYcL+ouDupjuFbckQhZ55JjTGJs GFzXfcWI4z9kVISKPCUZvGiOyySN/L1a52oHNkKjYn1Y3R5aiq7dId0wUu6n/mziWEHb eTiWayqDSp23isCpI4LMeAYu+hLtMbMj31opCM7xvHIyL+WuhimwLb6GNGIEMAdByGR1 YHVbqeDea1gNFgfmFWG45Vx4G1hy8WVKQZCkzFuj+U/MHq7F+aCeGtN1QPdxjGzeb5k2 YHmQ== X-Gm-Message-State: AKaTC02qzFBb1dVCauYkdBszbYRAqz/e8HlkhSC461qi+O2iBgWHpdy/2LJvo98+gikqYvAOitBNpBsmayTAuw== X-Received: by 10.202.187.10 with SMTP id l10mr2487735oif.191.1479935060978; Wed, 23 Nov 2016 13:04:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.29.146 with HTTP; Wed, 23 Nov 2016 13:04:20 -0800 (PST) From: Walter Huf Date: Wed, 23 Nov 2016 13:04:20 -0800 Message-ID: Subject: Randomized TCP client ports To: grub-devel@gnu.org Content-Type: multipart/alternative; boundary=001a113ce04099b1160541fe3b6d X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 21:04:24 -0000 --001a113ce04099b1160541fe3b6d Content-Type: text/plain; charset=UTF-8 In the course of developing netboot menus, and rebooting my virtual machine often, I am running into a problem where Grub is reusing the same TCP client ports across reboots, and my server (because of TCP TIME_WAIT) objects to this. I have a small change to set the initial client port based on grub_rtc_get_time_ms(), but I'm not sure if that functionality is available on all supported platforms. I'd like to provide a general contribution that works on all platforms. Is there a general way to get a pseudo-random integer that is different on each boot? Thank you very much! --001a113ce04099b1160541fe3b6d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In the course of developing netboot menus, and rebooting m= y virtual machine often, I am running into a problem where Grub is reusing = the same TCP client ports across reboots, and my server (because of TCP TIM= E_WAIT) objects to this.

I have a small change to set the init= ial client port based on grub_rtc_get_time_ms(), but I'm not sure if th= at functionality is available on all supported platforms. I'd like to p= rovide a general contribution that works on all platforms.

Is there a general way to get a pseudo-random integer that is diff= erent on each boot?

Thank you very much!
--001a113ce04099b1160541fe3b6d--