aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrigore Ion <ion.grigore@freescale.com>2015-10-02 13:39:55 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2015-10-05 14:31:03 +0300
commitd57805acd688135193e96ad828d6a40ac7c12d68 (patch)
tree321cbbba8faca8ad84ff56e5fcf0310c55374072
parent3d9eb97cd8c31826e0e3d5f6ed6e1a6b2e862457 (diff)
example:generator : Fix UDP checksum computation
The UDP checksum is computed in the CPU endianness. The returned result must be converted to the BE ordering when it is used to update the UDP checksum in a packet. Signed-off-by: Grigore Ion <ion.grigore@freescale.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r--example/generator/odp_generator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/example/generator/odp_generator.c b/example/generator/odp_generator.c
index f7aed76..f4f6038 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -241,7 +241,7 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool)
udp->dst_port = 0;
udp->length = odp_cpu_to_be_16(args->appl.payload + ODPH_UDPHDR_LEN);
udp->chksum = 0;
- udp->chksum = odph_ipv4_udp_chksum(pkt);
+ udp->chksum = odp_cpu_to_be_16(odph_ipv4_udp_chksum(pkt));
return pkt;
}