From ba7a3204cb5b2fa2f670c9b7e1df6c16237ea115 Mon Sep 17 00:00:00 2001 From: Joel Cunningham Date: Wed, 9 Aug 2017 10:13:41 -0500 Subject: [PATCH] tcp: use tcp_ack_now rather than manually setting TF_ACK_NOW --- src/core/tcp.c | 2 +- src/core/tcp_in.c | 2 +- src/include/lwip/priv/tcp_priv.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index d4aa3e02..b3c4c29e 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1921,7 +1921,7 @@ tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) if ((pcb->state != TIME_WAIT) && (pcb->state != LISTEN) && (pcb->flags & TF_ACK_DELAY)) { - pcb->flags |= TF_ACK_NOW; + tcp_ack_now(pcb); tcp_output(pcb); } diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index 0d5438e9..8493a31f 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -708,7 +708,7 @@ tcp_timewait_input(struct tcp_pcb *pcb) if ((tcplen > 0)) { /* Acknowledge data, FIN or out-of-window SYN */ - pcb->flags |= TF_ACK_NOW; + tcp_ack_now(pcb); tcp_output(pcb); } return; diff --git a/src/include/lwip/priv/tcp_priv.h b/src/include/lwip/priv/tcp_priv.h index 7e02b604..413f7d4f 100644 --- a/src/include/lwip/priv/tcp_priv.h +++ b/src/include/lwip/priv/tcp_priv.h @@ -446,7 +446,7 @@ struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg); do { \ if((pcb)->flags & TF_ACK_DELAY) { \ tcp_clear_flags(pcb, TF_ACK_DELAY); \ - (pcb)->flags |= TF_ACK_NOW; \ + tcp_ack_now(pcb); \ } \ else { \ (pcb)->flags |= TF_ACK_DELAY; \