Fixed LWIP_TCP_SACK_VALID and its usage

This commit is contained in:
goldsimon 2017-07-03 21:41:34 +02:00
parent 6796bcf7ad
commit 1a1c360f1d
2 changed files with 2 additions and 2 deletions

View File

@ -1587,7 +1587,7 @@ tcp_receive(struct tcp_pcb *pcb)
tcp_ack(pcb); tcp_ack(pcb);
#if LWIP_TCP_SACK_OUT #if LWIP_TCP_SACK_OUT
if (!LWIP_TCP_SACK_VALID(pcb, 0)) { if (LWIP_TCP_SACK_VALID(pcb, 0)) {
/* Normally the ACK for the data received could be piggy-backed on a data packet, /* Normally the ACK for the data received could be piggy-backed on a data packet,
but lwIP currently does not support including SACKs in data packets. So we force but lwIP currently does not support including SACKs in data packets. So we force
it to respond with an empty ACK packet (only if there is at least one SACK to be sent). it to respond with an empty ACK packet (only if there is at least one SACK to be sent).

View File

@ -246,7 +246,7 @@ struct tcp_pcb {
#if LWIP_TCP_SACK_OUT #if LWIP_TCP_SACK_OUT
/* SACK ranges to include in ACK packets (entry is invalid if left==right) */ /* SACK ranges to include in ACK packets (entry is invalid if left==right) */
struct tcp_sack_range rcv_sacks[LWIP_TCP_MAX_SACK_NUM]; struct tcp_sack_range rcv_sacks[LWIP_TCP_MAX_SACK_NUM];
#define LWIP_TCP_SACK_VALID(pcb, idx) ((pcb)->rcv_sacks[idx].left == (pcb)->rcv_sacks[idx].right) #define LWIP_TCP_SACK_VALID(pcb, idx) ((pcb)->rcv_sacks[idx].left != (pcb)->rcv_sacks[idx].right)
#endif /* LWIP_TCP_SACK_OUT */ #endif /* LWIP_TCP_SACK_OUT */
/* Retransmission timer. */ /* Retransmission timer. */