lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #35945] SYN packet should provide the recv MSS not the


From: Mason
Subject: [lwip-devel] [bug #35945] SYN packet should provide the recv MSS not the send MSS
Date: Wed, 28 Mar 2012 08:12:11 +0000
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Firefox/11.0 SeaMonkey/2.8

Follow-up Comment #4, bug #35945 (project lwip):

Simon Goldschmidt wrote:

> Finally found the time. This bug has been introduced after 1.4.0,
> when fixing bug #34587.

That's what I said in the original submission ;-)

> Fixed for both 1.4.1 and master branches. Thanks for reporting and
insisting
> on this, you saved me from introducing a new bug to 1.4.1 :-)

Your fix has a small problem (that I tried to avoid in mine).
If a port has set TCP_CALCULATE_EFF_SEND_MSS to 0, then
tcp_eff_send_mss is undefined and undeclared.


diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
@@ -1071,7 +1071,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb
*pcb)
packets, so ignore it here */
opts = (u32_t *)(void *)(seg->tcphdr + 1);
if (seg->flags & TF_SEG_OPTS_MSS) {
- *opts = TCP_BUILD_MSS_OPTION(pcb->mss);
+ *opts = TCP_BUILD_MSS_OPTION(tcp_eff_send_mss(TCP_MSS, &pcb->local_ip,
&pcb->remote_ip, PCB_ISIPV6(pcb)));
opts += 1;
}
#if LWIP_TCP_TIMESTAMPS


I think you need to guard the use of tcp_eff_send_mss
with the TCP_CALCULATE_EFF_SEND_MSS macro.


--- tcp_out.c   2012-02-23 10:57:12.859375000 +0100
+++ tcp_out.c   2012-03-22 13:44:36.750000000 +0100
@@ -1066,7 +1066,11 @@
      packets, so ignore it here */
   opts = (u32_t *)(void *)(seg->tcphdr + 1);
   if (seg->flags & TF_SEG_OPTS_MSS) {
-    *opts = TCP_BUILD_MSS_OPTION(pcb->mss);
+    int mss = TCP_MSS;
+#if TCP_CALCULATE_EFF_SEND_MSS
+    mss = tcp_eff_send_mss(TCP_MSS, &pcb->remote_ip);
+#endif
+    *opts = TCP_BUILD_MSS_OPTION(mss);
     opts += 1;
   }
 #if LWIP_TCP_TIMESTAMPS


The other small problem is that we're dealing with the RECEIVE MSS,
so the name of the function is misleading. That's why I suggested
renaming it. Perhaps the renaming can be done in the 1.5 branch?


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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