lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] Purpose of undocumented piece of code in tcp_output_segment


From: Leon Woestenberg
Subject: [lwip-devel] Purpose of undocumented piece of code in tcp_output_segments()?
Date: Fri, 18 Oct 2024 16:38:56 +0200

Hello all,

I am back in the land of lwIP (and realized I first started used it
more than 20 years ago first time). Congrats to all developers, great
achievement.


What is the purpose of this piece of code in tcp_output_segments()?
(i.e. the code that is going to transmit a TCP segment).

  len = (u16_t)((u8_t *)seg->tcphdr - (u8_t *)seg->p->payload);
  if (len == 0) {
    /** Exclude retransmitted segments from this count. */
    MIB2_STATS_INC(mib2.tcpoutsegs);
  }

  seg->p->len -= len;
  seg->p->tot_len -= len;

  seg->p->payload = seg->tcphdr;

A direct link:
https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_out.c#n1552

Thanks, Leon.



reply via email to

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