From 3a1c5944e77de27df2ee773971db1d8fb704ece0 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 2 Dec 2009 17:01:29 +0000 Subject: [PATCH] Fixed bug #27904: TCP sends too many ACKs: delay resetting tcp_input_pcb until after calling the pcb's callbacks --- CHANGELOG | 4 ++++ src/core/tcp_in.c | 9 ++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 858305a2..1f003583 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -46,6 +46,10 @@ HISTORY ++ Bugfixes: + 2009-12-02: Simon Goldschmidt + * tcp_in.c: Fixed bug #27904: TCP sends too many ACKs: delay resetting + tcp_input_pcb until after calling the pcb's callbacks + 2009-11-29: Simon Goldschmidt * tcp_in.c: Fixed bug #28054: Two segments with FIN flag on the out-of- sequence queue, also fixed PBUF_POOL leak in the out-of-sequence code diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index a355d03f..6fc4d5b0 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -290,7 +290,6 @@ tcp_input(struct pbuf *p, struct netif *inp) } tcp_input_pcb = pcb; err = tcp_process(pcb); - tcp_input_pcb = NULL; /* A return value of ERR_ABRT means that tcp_abort() was called and that the pcb has been freed. If so, we don't do anything. */ if (err != ERR_ABRT) { @@ -337,10 +336,9 @@ tcp_input(struct pbuf *p, struct netif *inp) TCP_EVENT_RECV(pcb, NULL, ERR_OK, err); } - /* If there were no errors, we try to send something out. */ - if (err == ERR_OK) { - tcp_output(pcb); - } + tcp_input_pcb = NULL; + /* Try to send something out. */ + tcp_output(pcb); #if TCP_INPUT_DEBUG #if TCP_DEBUG tcp_debug_print_state(pcb->state); @@ -348,6 +346,7 @@ tcp_input(struct pbuf *p, struct netif *inp) #endif /* TCP_INPUT_DEBUG */ } } + tcp_input_pcb = NULL; /* give up our reference to inseg.p */