From: Mike Frysinger Date: Sat, 18 Jul 2009 18:11:50 -0400 Subject: [U-Boot] [PATCH] - add dns In-Reply-To: <200907180114.25295.rgetz@blackfin.uclinux.org> References: <200907171553.08108.rgetz@blackfin.uclinux.org> <20090717220154.06523832E416@gemini.denx.de> <200907180114.25295.rgetz@blackfin.uclinux.org> Message-ID: <200907181811.52487.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday 18 July 2009 01:14:25 Robin Getz wrote: > + DnsOurPort = 10000 + (get_timer(0) % 4096); 4096 port range seems kind of small. i dont think the requests really need to be greater than 10000. not sure if services would get pissed about being below the 1024 limit though, so this is probably better: 1024 + (get_timer() % 0x8000); 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 */ > +void > +DnsStart(void) > +{ > + NetSetTimeout(DNS_TIMEOUT, DnsTimeout); > + NetSetHandler(DnsHandler); > + memset(NetServerEther, 0, 6); is clearing the ether address really necessary ? if so, why should the dns code care about it ? > +/* http://en.wikipedia.org/wiki/List_of_DNS_record_types */ > +enum dns_query_type { > + DNS_A_RECORD = 0x01, > + DNS_CNAME_RECORD = 0x05, > + DNS_MX_RECORD = 0x0f }; that last }; should be on a line by itself, and the last entry should still have a comma at the end -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/ceb9e8c5/attachment.pgp