@@ -244,7 +244,8 @@ int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t offset)
{
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
- if (offset >= pkt_hdr->frame_len)
+ if (offset >= pkt_hdr->frame_len &&
+ offset != ODP_PACKET_OFFSET_INVALID)
return -1;
pkt_hdr->l2_offset = offset;
@@ -266,7 +267,8 @@ int odp_packet_l3_offset_set(odp_packet_t pkt, uint32_t offset)
{
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
- if (offset >= pkt_hdr->frame_len)
+ if (offset >= pkt_hdr->frame_len &&
+ offset != ODP_PACKET_OFFSET_INVALID)
return -1;
pkt_hdr->l3_offset = offset;
@@ -288,7 +290,8 @@ int odp_packet_l4_offset_set(odp_packet_t pkt, uint32_t offset)
{
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
- if (offset >= pkt_hdr->frame_len)
+ if (offset >= pkt_hdr->frame_len &&
+ offset != ODP_PACKET_OFFSET_INVALID)
return -1;
pkt_hdr->l4_offset = offset;
Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- platform/linux-generic/odp_packet.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)