@@ -92,7 +92,7 @@ int cls_pkt_set_seq(odp_packet_t pkt)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
offset = odp_packet_l4_offset(pkt);
- CU_ASSERT_FATAL(offset != 0);
+ CU_ASSERT_FATAL(offset != ODP_PACKET_OFFSET_INVALID);
if (ip->proto == ODPH_IPPROTO_UDP)
status = odp_packet_copy_from_mem(pkt, offset + ODPH_UDPHDR_LEN,
@@ -116,7 +116,7 @@ uint32_t cls_pkt_get_seq(odp_packet_t pkt)
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
offset = odp_packet_l4_offset(pkt);
- if (!offset && !ip)
+ if (offset == ODP_PACKET_OFFSET_INVALID || ip == NULL)
return TEST_SEQ_INVALID;
if (ip->proto == ODPH_IPPROTO_UDP)
To test for a missing L4 offset, comparison must be made to symbol ODP_PACKET_OFFSET_INVALID rather than 0. Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- test/validation/classification/odp_classification_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)