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
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot