This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via b18dc645a68fd0ae50f1a361aa408b3e74e46c0d (commit) from 29dde30264da8106d64328b0d81eb19dad0065ac (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit b18dc645a68fd0ae50f1a361aa408b3e74e46c0d Author: Joe Savage joe.savage@arm.com Date: Wed Jan 4 14:52:35 2017 +0000
helper: fix odph_ipv4_csum functions for L3 offset 0
Fix a bug where odph_ipv4_csum_{valid, update} would interpret an L3 offset of zero as a sign that the packet has no L3 offset.
Signed-off-by: Joe Savage joe.savage@arm.com Reviewed-and-tested-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/helper/include/odp/helper/ip.h b/helper/include/odp/helper/ip.h index 4cfc00f..ba6e675 100644 --- a/helper/include/odp/helper/ip.h +++ b/helper/include/odp/helper/ip.h @@ -101,17 +101,18 @@ ODP_STATIC_ASSERT(sizeof(odph_ipv4hdr_t) == ODPH_IPV4HDR_LEN, */ static inline int odph_ipv4_csum_valid(odp_packet_t pkt) { + uint32_t offset; odp_u16be_t res = 0; uint16_t *w; int nleft = sizeof(odph_ipv4hdr_t); odph_ipv4hdr_t ip; odp_u16be_t chksum;
- if (!odp_packet_l3_offset(pkt)) + offset = odp_packet_l3_offset(pkt); + if (offset == ODP_PACKET_OFFSET_INVALID) return 0;
- odp_packet_copy_to_mem(pkt, odp_packet_l3_offset(pkt), - sizeof(odph_ipv4hdr_t), &ip); + odp_packet_copy_to_mem(pkt, offset, sizeof(odph_ipv4hdr_t), &ip);
w = (uint16_t *)(void *)&ip; chksum = ip.chksum; @@ -137,10 +138,10 @@ static inline odp_u16sum_t odph_ipv4_csum_update(odp_packet_t pkt) odph_ipv4hdr_t *ip; int nleft = sizeof(odph_ipv4hdr_t);
- if (!odp_packet_l3_offset(pkt)) + ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); + if (ip == NULL) return 0;
- ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL); w = (uint16_t *)(void *)ip; ip->chksum = odph_chksum(w, nleft); return ip->chksum;
-----------------------------------------------------------------------
Summary of changes: helper/include/odp/helper/ip.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
hooks/post-receive