Hi All,

The documentation for TCP_WND scaling says that TCP_WND is the total size
**with scaling applied**.

https://www.nongnu.org/lwip/2_1_x/group__lwip__opts__tcp.html#ga7f535a6efb5cdf86c3210e35ece1d6a7

So if I want to allow receive window scaling I put the following in
lwipopts.h

#define TCP_WND                 ((0xFFFF) << TCP_RCV_SCALE)
#define LWIP_WND_SCALE 1
#define TCP_RCV_SCALE 8

but then when compiling with clang I get this error because of the u16
type.

src/core/tcp.c:947:61: error: result of comparison of constant 8388480 with
expression of type 'u16_t' (aka 'unsigned short') is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
  947 |   if (TCP_SEQ_GEQ(new_right_edge, pcb->rcv_ann_right_edge +
LWIP_MIN((TCP_WND / 2), pcb->mss))) {
      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/tom/kynetra/../lwip/src/include/lwip/def.h:66:32: note: expanded from
macro 'LWIP_MIN'
   66 | #define LWIP_MIN(x , y)  (((x) < (y)) ? (x) : (y))
      |                                ^
/home/tom/kynetra/../lwip/src/include/lwip/priv/tcp_priv.h:112:41: note:
expanded from macro 'TCP_SEQ_GEQ'
  112 | #define TCP_SEQ_GEQ(a,b)    TCP_SEQ_LEQ(b,a)
      |                             ~~~~~~~~~~~~^~~~
/home/tom/kynetra/../lwip/src/include/lwip/priv/tcp_priv.h:110:45: note:
expanded from macro 'TCP_SEQ_LEQ'
  110 | #define TCP_SEQ_LEQ(a,b)    (!(TCP_SEQ_LT(b,a)))
      |                                ~~~~~~~~~~~~~^~
/home/tom/kynetra/../lwip/src/include/lwip/priv/tcp_priv.h:109:60: note:
expanded from macro 'TCP_SEQ_LT'
  109 | #define TCP_SEQ_LT(a,b)     (((u32_t)((u32_t)(a) - (u32_t)(b)) &
0x80000000u) != 0)

What is the correct way to allow window scaling and configure it ?

Thank you,

Tom
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to