DPDK patches and discussions
 help / color / mirror / Atom feed
* [Bug 1087] [Bug] tcp data len is incorrectly calculated in gro_tcp4_reassemble function
@ 2022-09-29  1:40 bugzilla
  2022-11-10  1:45 ` bugzilla
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla @ 2022-09-29  1:40 UTC (permalink / raw)
  To: dev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug 1087] [Bug] tcp data len is incorrectly calculated in gro_tcp4_reassemble function
  2022-09-29  1:40 [Bug 1087] [Bug] tcp data len is incorrectly calculated in gro_tcp4_reassemble function bugzilla
@ 2022-11-10  1:45 ` bugzilla
  0 siblings, 0 replies; 2+ messages in thread
From: bugzilla @ 2022-11-10  1:45 UTC (permalink / raw)
  To: dev

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

jinag (853048484@qq.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from jinag (853048484@qq.com) ---
fixed by: 
https://github.com/DPDK/dpdk/commit/b8a55871d5af6f5b8694b1cb5eacbc629734e403
https://github.com/DPDK/dpdk/commit/72f51b097a71fb9bdea13bdd254ff620b34c852e

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-10  1:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  1:40 [Bug 1087] [Bug] tcp data len is incorrectly calculated in gro_tcp4_reassemble function bugzilla
2022-11-10  1:45 ` bugzilla

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).