]> git.ipfire.org Git - people/ms/u-boot.git/commit
net/dns.c: Fix endian conversion for big-endian in dns command
authorBernhard Kaindl <bernhard.kaindl@thalesgroup.com>
Sat, 15 Oct 2011 23:59:22 +0000 (23:59 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 23 Oct 2011 21:34:19 +0000 (23:34 +0200)
commit6dc809f40721e5424367b09c8dbfe07da50b8ca9
tree0f5ec2f2eacdb4e3bfdaef96c32edd97e597af15
parentf5ca20c6b60acfce81f45a0a0a92a5e72de5b008
net/dns.c: Fix endian conversion for big-endian in dns command

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>
Acked-by: Mike Frysinger <vapier@gentoo.org>
net/dns.c