public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] - add dns
Date: Sat, 18 Jul 2009 21:15:02 -0400	[thread overview]
Message-ID: <200907182115.03882.vapier@gentoo.org> (raw)
In-Reply-To: <200907182027.00709.rgetz@blackfin.uclinux.org>

On Saturday 18 July 2009 20:27:00 Robin Getz wrote:
> On Sat 18 Jul 2009 18:11, Mike Frysinger pondered:
> > keep the modulus something with only 1 bit set so gcc will optimize into
> > a simple and operation.  probably add a comment about it too:
> > 	/* make src port a little random, but use something trivial to compute
> > */
>
> OK - So, this would give three different variations:
>
> net/sntp.c:     SntpOurPort = 10000 + (get_timer(0) % 4096);
> net/tftp.c:     TftpOurPort = 1024 + (get_timer(0) % 3072);
> net/nfs.c:      NfsOurPort = 4096 + (get_ticks() % 3072);
>
> Does it make sense to have 4 different ones? (not to me)...
>
> Or something new & common in ./net.c:random_port()

i would make a new patch that adds a new random_port() function and converts 
existing consumers to that, and then have the dns code rely on that.

and you should adopt my implementation because the generated code is much much 
nicer than the others ;)

a quick google shows:
 - sntp - any non-zero source port is OK
 - tftp - "between 0 and 65535"
 - nfs - couldnt find anything, but i'm pretty sure there isnt one

get_ticks() and get_timer(0) are pretty much equivalent
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090718/905c3665/attachment.pgp 

  reply	other threads:[~2009-07-19  1:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-17 19:53 [U-Boot] [PATCH] - add dns Robin Getz
2009-07-17 20:55 ` Wolfgang Denk
2009-07-17 21:45   ` Robin Getz
2009-07-17 22:01     ` Wolfgang Denk
2009-07-17 23:19       ` Robin Getz
2009-07-18  5:14       ` Robin Getz
2009-07-18 22:11         ` Mike Frysinger
2009-07-19  0:27           ` Robin Getz
2009-07-19  1:15             ` Mike Frysinger [this message]
2009-07-19 23:30               ` Robin Getz
2009-07-20  2:36                 ` Mike Frysinger
2009-07-18  1:20   ` Robin Getz
2009-07-19  7:48     ` Wolfgang Denk
2009-07-19 16:17       ` Robin Getz
2009-07-20 18:53 ` [U-Boot] [PATCH] v3 " Robin Getz
2009-07-21  4:48   ` Ben Warren

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=200907182115.03882.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=u-boot@lists.denx.de \
    /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