lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #62351] Endless cycle under high load


From: Kirill Trofimov
Subject: [lwip-devel] [bug #62351] Endless cycle under high load
Date: Fri, 22 Apr 2022 08:00:11 -0400 (EDT)

URL:
  <https://savannah.nongnu.org/bugs/?62351>

                 Summary: Endless cycle under high load
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: ktrofimov
            Submitted on: Пт 22 апр 2022 12:00:09
                Category: pbufs
                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: 2.1.2

    _______________________________________________________

Details:

Under reasonably high load Rx circular buffer could be filled up completely
and u16_t inet_chksum_pbuf(struct pbuf *p) function falls into endless cycle

for (q = p; q != NULL; q = q->next) {
    acc += LWIP_CHKSUM(q->payload, q->len);
    acc = FOLD_U32T(acc);
    if (q->len % 2 != 0) {
      swapped = !swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
  }

Possible solution (while it could drop some packets)

for (q = p; q != NULL; q = q->next) {
    acc += LWIP_CHKSUM(q->payload, q->len);
    acc = FOLD_U32T(acc);
    if (q->len % 2 != 0) {
      swapped = !swapped;
      acc = SWAP_BYTES_IN_WORD(acc);
    }
+   if( q->next == p )
+       return -1;
  }





    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?62351>

_______________________________________________
  Сообщение отправлено по Savannah
  https://savannah.nongnu.org/




reply via email to

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