]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
fixed bug #28288: Data after FIN in oos queue
authorSimon Goldschmidt <goldsimon@gmx.de>
Tue, 27 Sep 2011 19:08:49 +0000 (21:08 +0200)
committerSimon Goldschmidt <goldsimon@gmx.de>
Tue, 27 Sep 2011 19:08:49 +0000 (21:08 +0200)
CHANGELOG
src/core/tcp_in.c

index 95190ce82df13bef1a95fe44856e1684ce3b88d6..998fa7e078734d7b20d805ce192967c9c214a693 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -65,6 +65,9 @@ HISTORY
 
  ++ Bugfixes:
 
+  2011-09-27: Simon Goldschmidt
+  * tcp_in.c: fixed bug #28288: Data after FIN in oos queue
+
   2011-09-27: Simon Goldschmidt
   * dhcp.c: fixed bug #34406 dhcp_option_hostname() can overflow the pbuf
 
index c659b494337e6999cdfe8e8b2f5d30549be69f42..704d310ceb2d02b0a913e79c30541f97d2fafaed 100644 (file)
@@ -892,6 +892,8 @@ tcp_receive(struct tcp_pcb *pcb)
   u16_t new_tot_len;
   int found_dupack = 0;
 
+  LWIP_ASSERT("tcp_receive: wrong state", pcb->state >= ESTABLISHED);
+
   if (flags & TCP_ACK) {
     right_wnd_edge = pcb->snd_wnd + pcb->snd_wl2;
 
@@ -1132,8 +1134,10 @@ tcp_receive(struct tcp_pcb *pcb)
   }
 
   /* If the incoming segment contains data, we must process it
-     further. */
-  if (tcplen > 0) {
+     further unless the pcb already received a FIN.
+     (RFC 793, chapeter 3.9, "SEGMENT ARRIVES" in states CLOSE-WAIT, CLOSING,
+     LAST-ACK and TIME-WAIT: "Ignore the segment text.") */
+  if ((tcplen > 0) && (pcb->state < CLOSE_WAIT)) {
     /* This code basically does three things:
 
     +) If the incoming segment contains data that is the next