lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [bug #54506] LWIP_CHECKSUM_ON_COPY causes wrong checksum (0


From: Sebastian Maier
Subject: [lwip-devel] [bug #54506] LWIP_CHECKSUM_ON_COPY causes wrong checksum (0xFFFF)
Date: Mon, 13 Aug 2018 06:55:17 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

URL:
  <http://savannah.nongnu.org/bugs/?54506>

                 Summary: LWIP_CHECKSUM_ON_COPY causes wrong checksum (0xFFFF)
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: basti
            Submitted on: Mon 13 Aug 2018 10:55:16 AM UTC
                Category: TCP
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

I am currently using lwIP (HEAD) on x86-64 with a custom OS and an Intel
e1000(e) ethernet adapter to transfer data via TCP.
For debugging purposes I implemented an echoserver (sending and receiving
about 2 GiB of random data @ ~ 20 MiB/s) and used the following config
options:


  #define LWIP_NETIF_TX_SINGLE_PBUF  1
  #define LWIP_CHECKSUM_ON_COPY      1


After some time Wireshark shows TCP packages (sent by lwIP) that have an
invalid TCP checksum of 0xFFFF.
By enabling


  #define TCP_CHECKSUM_ON_COPY_SANITY_CHECK 1


the assertion in line


  tcp_out.c:1592


is triggered whenever the precalculated checksum of the segment (seg->chksum)
is exactly the same as the checksum of the header (acc). In this case
apperently the overall checksum (seg->tcphdr->chksum) should be 0x0 (but is
0xFFFF instead).

Either of the patches attached worked for me. Although I am not entirely sure,
whether these patches will work for all weird architectures out there.

If required I can also provide a Wireshark capture of the problem or a patch
that prints more debugging information (during the checksum-on-copy
calculation).



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 13 Aug 2018 10:55:16 AM UTC  Name: patch1.diff  Size: 529B   By:
basti

<http://savannah.nongnu.org/bugs/download.php?file_id=44770>
-------------------------------------------------------
Date: Mon 13 Aug 2018 10:55:16 AM UTC  Name: patch2.diff  Size: 536B   By:
basti

<http://savannah.nongnu.org/bugs/download.php?file_id=44771>
-------------------------------------------------------
Date: Mon 13 Aug 2018 10:55:16 AM UTC  Name: patch3.diff  Size: 535B   By:
basti

<http://savannah.nongnu.org/bugs/download.php?file_id=44772>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?54506>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]