]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fixed bug #34587: TCP_BUILD_MSS_OPTION doesn't consider netif->mtu, causes slow network
authorSimon Goldschmidt <goldsimon@gmx.de>
Tue, 18 Oct 2011 18:11:39 +0000 (20:11 +0200)
committerSimon Goldschmidt <goldsimon@gmx.de>
Tue, 18 Oct 2011 18:11:39 +0000 (20:11 +0200)
CHANGELOG
src/core/tcp_out.c
src/include/lwip/tcp_impl.h

index caa6090fa6d5101357b39bf648912e8b6d609e93..a93d34c3bdb5aae9015716b74684ab87b1c19a20 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -69,6 +69,10 @@ HISTORY
 
  ++ Bugfixes:
 
+  2011-10-18: Simon Goldschmidt
+  * tcp_impl.h, tcp_out.c: fixed bug #34587: TCP_BUILD_MSS_OPTION doesn't
+    consider netif->mtu, causes slow network
+
   2011-10-18: Simon Goldschmidt
   * sockets.c: fixed bug #34581 missing parentheses in udplite sockets code
 
index 93ed21fa7224d6fe4574c272c1371eb00f20ef4a..49c9679aa5948a55f9993d7eea156fe794c4754d 100644 (file)
@@ -1067,7 +1067,7 @@ tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb)
   //LWIP_ASSERT("seg->tcphdr not aligned", ((mem_ptr_t)seg->tcphdr % MEM_ALIGNMENT) == 0);
   opts = (u32_t *)(void *)(seg->tcphdr + 1);
   if (seg->flags & TF_SEG_OPTS_MSS) {
-    TCP_BUILD_MSS_OPTION(*opts);
+    *opts = TCP_BUILD_MSS_OPTION(pcb->mss);
     opts += 1;
   }
 #if LWIP_TCP_TIMESTAMPS
index e9be9d95f314382a01b41bf2dd2f3f54951e7446..694583fa52090cb67716765ac9e5b4767f6ce9d6 100644 (file)
@@ -303,10 +303,7 @@ struct tcp_seg {
   (flags & TF_SEG_OPTS_TS  ? 12 : 0)
 
 /** This returns a TCP header option for MSS in an u32_t */
-#define TCP_BUILD_MSS_OPTION(x) (x) = PP_HTONL(((u32_t)2 << 24) |          \
-                                               ((u32_t)4 << 16) |          \
-                                               (((u32_t)TCP_MSS / 256) << 8) | \
-                                               (TCP_MSS & 255))
+#define TCP_BUILD_MSS_OPTION(mss) htonl(0x02040000 | ((mss) & 0xFFFF))
 
 /* Global variables: */
 extern struct tcp_pcb *tcp_input_pcb;