diff options
author | Ashwin Sekhar T K <asekhar@marvell.com> | 2021-04-29 17:38:27 +0530 |
---|---|---|
committer | Matias Elo <matias.elo@nokia.com> | 2021-05-05 13:56:02 +0300 |
commit | a56601f11dd1a22420f224da6fc63b43f216756e (patch) | |
tree | eeb6701d503b2efad0338c21860ca7da8337872d /test/validation/api | |
parent | ab29119cb6b71bb07afdc8022e6a561fcea20098 (diff) |
validation: packet: fix packet head/tail pull lengths
According to the spec packet pull head/tail may pull up to segment
length minus 1 bytes. Fix the tests to align to the spec.
Signed-off-by: Ashwin Sekhar T K <asekhar@marvell.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test/validation/api')
-rw-r--r-- | test/validation/api/packet/packet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/validation/api/packet/packet.c b/test/validation/api/packet/packet.c index b5d64743e..cd3009ce3 100644 --- a/test/validation/api/packet/packet.c +++ b/test/validation/api/packet/packet.c @@ -916,7 +916,7 @@ static void _verify_headroom_shift(odp_packet_t *pkt, extended = 1; } } else { - if ((uint32_t)abs(shift) <= seg_data_len) { + if ((uint32_t)abs(shift) < seg_data_len) { data = odp_packet_pull_head(*pkt, -shift); extended = 0; } else { @@ -1019,7 +1019,7 @@ static void _verify_tailroom_shift(odp_packet_t *pkt, CU_ASSERT(l3_off == odp_packet_l3_offset(*pkt)); CU_ASSERT(l4_off == odp_packet_l4_offset(*pkt)); } else { - if ((uint32_t)abs(shift) <= seg_data_len) { + if ((uint32_t)abs(shift) < seg_data_len) { tail = odp_packet_pull_tail(*pkt, -shift); extended = 0; } else { |