Fixed bug #27215: TCP sent() callback gives leadin and trailing 1 byte len (SYN/FIN)

This commit is contained in:
goldsimon 2009-10-18 08:30:44 +00:00
parent b4404ff0c8
commit b7d7559cc9
2 changed files with 11 additions and 2 deletions

View File

@ -43,6 +43,10 @@ HISTORY
++ Bugfixes:
2009-10-18: Simon Goldschmidt
* tcp_in.c: Fixed bug #27215: TCP sent() callback gives leadin and
trailing 1 byte len (SYN/FIN)
2009-10-16: Simon Goldschmidt
* tcp_out.c: Fixed bug #27315: zero window probe and FIN

View File

@ -96,6 +96,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
struct tcp_pcb_listen *lpcb;
u8_t hdrlen;
err_t err;
u8_t old_state;
PERF_START;
@ -288,7 +289,7 @@ tcp_input(struct pbuf *p, struct netif *inp)
return;
}
}
old_state = pcb->state;
tcp_input_pcb = pcb;
err = tcp_process(pcb);
tcp_input_pcb = NULL;
@ -314,7 +315,11 @@ tcp_input(struct pbuf *p, struct netif *inp)
called when new send buffer space is available, we call it
now. */
if (pcb->acked > 0) {
TCP_EVENT_SENT(pcb, pcb->acked, err);
/* Prevent ACK for SYN or FIN to generate a sent event */
if ((pcb->acked != 1) || ((old_state != SYN_RCVD) &&
(pcb->state != FIN_WAIT_2) && (pcb->state != TIME_WAIT))) {
TCP_EVENT_SENT(pcb, pcb->acked, err);
}
}
if (recv_data != NULL) {