DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [Bug 1087] [Bug] tcp data len is incorrectly calculated in gro_tcp4_reassemble function
Date: Thu, 29 Sep 2022 01:40:26 +0000	[thread overview]
Message-ID: <bug-1087-3@http.bugs.dpdk.org/> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=1087

            Bug ID: 1087
           Summary: [Bug] tcp data len is incorrectly calculated in
                    gro_tcp4_reassemble function
           Product: DPDK
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: other
          Assignee: dev@dpdk.org
          Reporter: 853048484@qq.com
  Target Milestone: ---

Hello:
In gro_tcp4_reassemble function, tcp data len is calculated:
tcp_dl = pkt->pkt_len - hdr_len;
https://github.com/DPDK/dpdk/blob/v22.07/lib/gro/gro_tcp4.c#L232

if packets < 60 bytes, pkt_len will contain padding bytes, tcp_dl is
incorrectly calculated. this will result the wrong data length after gro.

diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c index
7498c66141..cbba9fed5e 100644
--- a/lib/gro/gro_tcp4.c
+++ b/lib/gro/gro_tcp4.c
@@ -229,7 +229,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
         * Don't process the packet whose payload length is less than or
         * equal to 0.
         */
-       tcp_dl = pkt->pkt_len - hdr_len;
+       tcp_dl = rte_be_to_cpu_16(ipv4_hdr->total_length) - hdr_len;
        if (tcp_dl <= 0)
                return -1;

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2022-09-29  1:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29  1:40 bugzilla [this message]
2022-11-10  1:45 ` bugzilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-1087-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).