aboutsummaryrefslogtreecommitdiff
path: root/helper/test/odp_chksum.c
diff options
context:
space:
mode:
authorGrigore Ion <ion.grigore@freescale.com>2016-01-11 11:13:01 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-01-11 15:23:09 +0300
commitbc0821f4649b4425b088f60773e4438c3ccd0543 (patch)
treecbf82fb065a7f886ef81cf8d1acbfd23225f3abd /helper/test/odp_chksum.c
parentad831c8da063a3150b8a3d5ef36fa03a3ff2ee28 (diff)
helper: fix UDP checksum computation
This patch fixes the following problems: - checksum computation for LE platforms - checksum computation for packets having the UDP length not a multiple of 2 - checksum computation in the test and the example applications Signed-off-by: Grigore Ion <ion.grigore@freescale.com> Reviewed-by: Ilya Maximets <i.maximets@samsung.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'helper/test/odp_chksum.c')
-rw-r--r--helper/test/odp_chksum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/helper/test/odp_chksum.c b/helper/test/odp_chksum.c
index 1d417a881..b71fabc64 100644
--- a/helper/test/odp_chksum.c
+++ b/helper/test/odp_chksum.c
@@ -194,9 +194,9 @@ int main(int argc TEST_UNUSED, char *argv[] TEST_UNUSED)
if (udp->chksum == 0)
return -1;
- printf("chksum = 0x%x\n", udp->chksum);
+ printf("chksum = 0x%x\n", odp_be_to_cpu_16(udp->chksum));
- if (udp->chksum != 0xab2d)
+ if (odp_be_to_cpu_16(udp->chksum) != 0x7e5a)
status = -1;
odp_packet_free(test_packet);