From: Wolfgang Denk Date: Sun, 23 Oct 2011 22:57:04 +0200 Subject: [U-Boot] [PATCH] net/dns.c: Fix endian conversion for big-endian in dns command In-Reply-To: <1318759162-10523-1-git-send-email-bernhard.kaindl@gmx.net> References: <201110141141.40124.vapier@gentoo.org> <1318759162-10523-1-git-send-email-bernhard.kaindl@gmx.net> Message-ID: <20111023205704.978EE1408E9B@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Bernhard Kaindl, In message <1318759162-10523-1-git-send-email-bernhard.kaindl@gmx.net> you wrote: > From: Bernhard Kaindl > > net/dns.c used endian conversion macros wrongly (shorts in reply > were put swapped into CPU, and then ntohs() was used to swap it > back, which broke on big-endian). > > Fix this by using the correct linux conversion macro for reading > a unaligned short in network byte order: get_unaligned_be16() > Thanks to Mike Frysinger pointing at the best macro to use. > > Tested on big and little endian qemu boards (mips and versatile) > > Signed-off-by: Bernhard Kaindl > Cc: Pieter Voorthuijsen > Cc: Robin Getz > --- > net/dns.c | 20 ++++++++------------ > 1 files changed, 8 insertions(+), 12 deletions(-) Applied, thanks. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The Wright Bothers weren't the first to fly. They were just the first not to crash.