public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] net/dns.c: Fix endian conversion for big-endian in dns command
Date: Sun, 23 Oct 2011 22:57:04 +0200	[thread overview]
Message-ID: <20111023205704.978EE1408E9B@gemini.denx.de> (raw)
In-Reply-To: <1318759162-10523-1-git-send-email-bernhard.kaindl@gmx.net>

Dear Bernhard Kaindl,

In message <1318759162-10523-1-git-send-email-bernhard.kaindl@gmx.net> you wrote:
> From: Bernhard Kaindl <bernhard.kaindl@thalesgroup.com>
> 
> 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 <bernhard.kaindl@thalesgroup.com>
> Cc: Pieter Voorthuijsen <pieter.voorthuijsen@prodrive.nl>
> Cc: Robin Getz <rgetz@blackfin.uclinux.org>
> ---
>  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.

      parent reply	other threads:[~2011-10-23 20:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-12 21:23 [U-Boot] [PATCH] net/dns.c: Fix broken endian handling in dns command Bernhard Kaindl
2011-10-12 21:48 ` Mike Frysinger
2011-10-14  7:44   ` Bernhard Kaindl
2011-10-14 15:41     ` Mike Frysinger
2011-10-16  9:59       ` [U-Boot] [PATCH] net/dns.c: Fix endian conversion for big-endian " Bernhard Kaindl
2011-10-16 12:11         ` Robin Getz
2011-10-16 15:14         ` Mike Frysinger
2011-10-23 20:57         ` Wolfgang Denk [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=20111023205704.978EE1408E9B@gemini.denx.de \
    --to=wd@denx.de \
    --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