grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>, hufman@gmail.com
Cc: dkiper@net-space.pl
Subject: Re: Randomized TCP client ports
Date: Sat, 26 Nov 2016 09:41:07 +0300	[thread overview]
Message-ID: <85435f49-f52a-6ee0-fd35-ed94f042dbe5@gmail.com> (raw)
In-Reply-To: <20161125214729.GB3237@router-fw-old.local.net-space.pl>

26.11.2016 00:47, Daniel Kiper пишет:
> Hi Walter,
> 
> On Wed, Nov 23, 2016 at 01:04:20PM -0800, Walter Huf wrote:
>> 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.
>>

This function is not universally available; it is used as implementation
of grub_get_time_ms() which you probably should use instead, as it is
guaranteed to exist.

>> Is there a general way to get a pseudo-random integer that is different on
>> each boot?
> 
> I think that you should take a look, at least, at random module,
> grub-core/lib/random.c, etc.
> 

It relies on platform providing random value and so far it works for x86
with tsc and pmtimer only.


      reply	other threads:[~2016-11-26  6:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 21:04 Randomized TCP client ports Walter Huf
2016-11-25 21:47 ` Daniel Kiper
2016-11-26  6:41   ` Andrei Borzenkov [this message]

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=85435f49-f52a-6ee0-fd35-ed94f042dbe5@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=hufman@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).