lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #51326] tcpflags_t is too small for TF_RTO for some co


From: Joel Cunningham
Subject: [lwip-devel] [bug #51326] tcpflags_t is too small for TF_RTO for some configurations
Date: Tue, 27 Jun 2017 17:00:46 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #2, bug #51326 (project lwip):

What I'm seeing with MSVC 2013 (and win32 port) is that struct tcp_pcb is 200
bytes regardless of whether tcpflags_t is a u8_t or u16_t.

>From deeper investigation of the u8_t case, remote_port starts on byte 68 (4
byte boundary) and then we have 6 bytes (2 for remote_port + 4 u8_ts).  This
means for tmr to be on the next 4 byte boundary, there are two bytes of
padding.

Here's the offsets:


u8_t tcpflags_t:
remote_port:  68
flags:        70
polltmr:      71
pollinterval: 72
last_timer:   73
tmr:          76

u16_t tcpflags_t:
remote_port:  68
flags:        70
polltmr:      72
pollinterval: 73
last_timer:   74
tmr:          76


Attached patch changes to u16_t

I do wonder how much we should put into this kind of optimization.  There is
an enum in TCP_PCB_COMMON and depending on compiler options (GCC can make
enums storage only big enough for the defined values) this could throw off
calculations

(file #41058)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-tcp-switch-tcpflags_t-to-u16_t-for-all-cases-bug-513.patch
Size:1 KB


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/




reply via email to

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